mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-08-07 12:59:45 +00:00
Individually log failure for non-vital missing POST variables.
This commit is contained in:
parent
71ec9925f4
commit
2e4d869370
1 changed files with 13 additions and 7 deletions
|
@ -66,6 +66,16 @@ namespace tawashi {
|
||||||
return post_data_it->second;
|
return post_data_it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boost::string_ref get_value_from_post_log_failure (const cgi::PostMapType& parPost, boost::string_ref parKey) {
|
||||||
|
try {
|
||||||
|
return get_value_from_post(parPost, parKey);
|
||||||
|
}
|
||||||
|
catch (const MissingPostVarError& e) {
|
||||||
|
spdlog::get("statuslog")->info(e.what());
|
||||||
|
return boost::string_ref();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string hashed_ip (const std::string& parIP) {
|
std::string hashed_ip (const std::string& parIP) {
|
||||||
using dhandy::tags::hex;
|
using dhandy::tags::hex;
|
||||||
|
|
||||||
|
@ -115,13 +125,9 @@ namespace tawashi {
|
||||||
statuslog->error(e.what());
|
statuslog->error(e.what());
|
||||||
return make_error_redirect(HttpStatusCodes::Code500_InternalServerError, e.reason());
|
return make_error_redirect(HttpStatusCodes::Code500_InternalServerError, e.reason());
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
lang = get_value_from_post(post, make_string_ref(g_language_key));
|
lang = get_value_from_post_log_failure(post, make_string_ref(g_language_key));
|
||||||
duration = get_value_from_post(post, make_string_ref(g_duration_key));
|
duration = get_value_from_post_log_failure(post, make_string_ref(g_duration_key));
|
||||||
}
|
|
||||||
catch (const MissingPostVarError& e) {
|
|
||||||
statuslog->info(e.what());
|
|
||||||
}
|
|
||||||
|
|
||||||
const SettingsBag& settings = this->settings();
|
const SettingsBag& settings = this->settings();
|
||||||
const auto max_sz = settings.as<uint32_t>("max_pastie_size");
|
const auto max_sz = settings.as<uint32_t>("max_pastie_size");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue