Standardize error reporting across services:
- Add `event_type` to error data. - Replace dynamic `type` with "ERROR" for task results and error messages.
This commit is contained in:
parent
94d0c6e4ad
commit
ea576e6558
@ -205,8 +205,9 @@ static void sendTaskError(const QString &type, const QString &materialId, const
|
||||
const QString &description, const QByteArray &screenshot, int eventId) {
|
||||
QJsonObject errorData;
|
||||
errorData["status"] = QStringLiteral("error");
|
||||
errorData["event_type"] = type;
|
||||
errorData["description"] = description;
|
||||
sendTaskResult(type, materialId, bankName, errorData, eventId);
|
||||
sendTaskResult(QStringLiteral("ERROR"), materialId, bankName, errorData, eventId);
|
||||
|
||||
if (!screenshot.isEmpty()) {
|
||||
const QString message = QStringLiteral("[%1] bank=%2 material=%3: %4")
|
||||
|
||||
@ -95,10 +95,11 @@ void BankSettingsWindow::startCheckPinCode(const QString &appCode) {
|
||||
static void sendTaskError(const QString &type, const QString &materialId, const QString &bankName) {
|
||||
QJsonObject errData;
|
||||
errData["status"] = "error";
|
||||
errData["event_type"] = type;
|
||||
errData["description"] = "Bank profile disabled";
|
||||
|
||||
QJsonObject obj;
|
||||
obj["type"] = type;
|
||||
obj["type"] = "ERROR";
|
||||
obj["material_id"] = materialId;
|
||||
obj["bank_name"] = bankName;
|
||||
obj["data"] = errData;
|
||||
|
||||
@ -57,10 +57,11 @@ QString getColorByStatus(const BankProfileInfo &app) {
|
||||
static void sendTaskErrorToServer(const QString &type, const QString &materialId, const QString &bankName) {
|
||||
QJsonObject errData;
|
||||
errData["status"] = "error";
|
||||
errData["event_type"] = type;
|
||||
errData["description"] = "Bank profile disabled";
|
||||
|
||||
QJsonObject obj;
|
||||
obj["type"] = type;
|
||||
obj["type"] = "ERROR";
|
||||
obj["material_id"] = materialId;
|
||||
obj["bank_name"] = bankName;
|
||||
obj["data"] = errData;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user