diff --git a/README.md b/README.md index 11e33e3..df81bbe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ --->[Русская версия](https://git.foxarmy.org/leca/checks-parser/src/branch/master/README.ru.md)<--> +-->[Русская версия](https://git.foxarmy.org/leca/checks-parser/src/branch/master/README.ru.md)<-- # Checks parser checks parser is a program that help parsing different checks to csv. diff --git a/README.ru.md b/README.ru.md index 35271f8..8a5c7a3 100644 --- a/README.ru.md +++ b/README.ru.md @@ -1,4 +1,4 @@ --->[English version](https://git.foxarmy.org/leca/checks-parser/src/branch/master/README.md)<--> +-->[English version](https://git.foxarmy.org/leca/checks-parser/src/branch/master/README.md)<-- # Чек парсер Чек парсер - это приложение, позволяющее доставать содержимое чека и переводить его в .csv файлы. diff --git a/mainwindow.cpp b/mainwindow.cpp index cb75245..59474c7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -87,6 +87,13 @@ void MainWindow::on_parseButton_clicked() { infoDialog.setWindowTitle(tr("Captcha is incorrect")); infoDialog.exec(); break; + } else if (!strcmp(e.what(), "Internal server error")) { + QMessageBox infoDialog; + infoDialog.setText(tr("Internal server error. Please, try again later.")); + infoDialog.setIcon(QMessageBox::Critical); + infoDialog.setWindowTitle(tr("Internal server error")); + infoDialog.exec(); + return; } else if (!strcmp(e.what(), "Does not exist")) { QMessageBox infoDialog; infoDialog.setText(tr("Check not found. Please, ensure correctness of entered data.")); diff --git a/translations/en_US.ts b/translations/en_US.ts index 5e1a6b4..8e79468 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -118,7 +118,7 @@ Funds income Приход средств - Funds incode + Funds income @@ -160,37 +160,47 @@ + Internal server error. Please, try again later. + Internal server error. Please, try again later. + + + + Internal server error + Internal server error + + + Check not found. Please, ensure correctness of entered data. Check not found. Please, ensure correctness of entered data. - + Check was not found - + An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer. An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer. - + Error in parsing Error in parsing - + Please, select a picture where QR code that contains info about check is present Please, select a picture where QR code that contains info about check is present - - + + Picture was not selected Picture was not selected - + Please, select a picture to scan Please, select a picture to scan diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index bda4749..a2bf595 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -60,7 +60,7 @@ OCR Оптическое Распознавание Символов - ОРС + ОРС @@ -156,37 +156,47 @@ + Internal server error. Please, try again later. + Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже. + + + + Internal server error + Внутренняя ошибка сервера + + + Check not found. Please, ensure correctness of entered data. Чек не найден. Пожалуйста, убедитесь в правильности введённых данных. - + Check was not found Чек не найден - + An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer. Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику. - + Error in parsing Ошибка в парсинге - + Please, select a picture where QR code that contains info about check is present Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке - - + + Picture was not selected Изображение не было выбрано - + Please, select a picture to scan Пожалуйста, выберете изображение для сканирования diff --git a/utils/utils.cpp b/utils/utils.cpp index c2673a8..e220616 100644 --- a/utils/utils.cpp +++ b/utils/utils.cpp @@ -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"); }