added handler on internal server error

This commit is contained in:
2024-12-09 17:34:36 +03:00
parent baa8ae6e65
commit 22922aecaa
6 changed files with 47 additions and 18 deletions

View File

@@ -124,6 +124,8 @@ Check parseOfdRuAnswer(std::string html) {
if ((products.size() + amounts.size() + prices.size()) == 0) {
if (html == "Bad Request4") { // Failed to solve a captcha
throw OfdRequestException("Incorrect captcha");
} else if (html.find("500 - Internal server error.") != std::string::npos) {
throw OfdRequestException("Internal server error");
} else { // Most likely that the check does not exist
throw OfdRequestException("Does not exist");
}