mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2024-12-27 21:35:41 +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;
|
||||
}
|
||||
|
||||
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) {
|
||||
using dhandy::tags::hex;
|
||||
|
||||
|
@ -115,13 +125,9 @@ namespace tawashi {
|
|||
statuslog->error(e.what());
|
||||
return make_error_redirect(HttpStatusCodes::Code500_InternalServerError, e.reason());
|
||||
}
|
||||
try {
|
||||
lang = get_value_from_post(post, make_string_ref(g_language_key));
|
||||
duration = get_value_from_post(post, make_string_ref(g_duration_key));
|
||||
}
|
||||
catch (const MissingPostVarError& e) {
|
||||
statuslog->info(e.what());
|
||||
}
|
||||
|
||||
lang = get_value_from_post_log_failure(post, make_string_ref(g_language_key));
|
||||
duration = get_value_from_post_log_failure(post, make_string_ref(g_duration_key));
|
||||
|
||||
const SettingsBag& settings = this->settings();
|
||||
const auto max_sz = settings.as<uint32_t>("max_pastie_size");
|
||||
|
|
Loading…
Reference in a new issue