mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2024-12-27 21:35:41 +00:00
Add reason_code to string lookup.
This commit is contained in:
parent
ec80734625
commit
57dc0c7717
1 changed files with 9 additions and 1 deletions
|
@ -41,7 +41,15 @@ namespace tawashi {
|
||||||
if (reason_int >= 0 and reason_int < ErrorReasons::_size())
|
if (reason_int >= 0 and reason_int < ErrorReasons::_size())
|
||||||
reason_code = ErrorReasons::_from_integral(reason_int);
|
reason_code = ErrorReasons::_from_integral(reason_int);
|
||||||
|
|
||||||
parContext["error_message"] = "No error";
|
std::array<const char*, ErrorReasons::_size()> err_descs {
|
||||||
|
"Submitted pastie is either too short or too long and was rejected.",
|
||||||
|
"Submitted pastie couldn't be saved.",
|
||||||
|
"The pastie was not saved because the client is submitting too many pasties too quickly. Please wait a bit longer and try again.",
|
||||||
|
"An unknown error was raised.",
|
||||||
|
"Unable to connect to Redis."
|
||||||
|
};
|
||||||
|
|
||||||
|
parContext["error_message"] = err_descs[reason_code];
|
||||||
parContext["error_code"] = std::to_string(err_code);
|
parContext["error_code"] = std::to_string(err_code);
|
||||||
parContext["error_id"] = std::to_string(reason_code);
|
parContext["error_id"] = std::to_string(reason_code);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue