Skip to content

Commit

Permalink
Providers alert if client details update fails (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
HughParry authored Dec 11, 2024
1 parent a657eb6 commit aa37762
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/locale/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Lösung konnte nicht als verarbeitet markiert werden",
"TABLES_UNDEFINED": "Tabellen undefiniert",
"CONNECTION_UNDEFINED": "Verbindung undefiniert",
"COMMITMENT_FLAG_FAILED": "Verpflichtung konnte nicht als verarbeitet markiert werden"
"COMMITMENT_FLAG_FAILED": "Verpflichtung konnte nicht als verarbeitet markiert werden",
"UNKNOWN": "Unbekannter Datenbankfehler"
},
"CAPTCHA": {
"PARSE_ERROR": "Fehler beim Parsen des Captchas",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Failed to flag solution as processed",
"TABLES_UNDEFINED": "Tables undefined",
"CONNECTION_UNDEFINED": "Connection undefined",
"COMMITMENT_FLAG_FAILED": "Failed to flag commitment as processed"
"COMMITMENT_FLAG_FAILED": "Failed to flag commitment as processed",
"UNKNOWN": "Unknown database error"
},
"CAPTCHA": {
"PARSE_ERROR": "Error parsing captcha",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Error al marcar la solución como procesada",
"TABLES_UNDEFINED": "Tablas indefinidas",
"CONNECTION_UNDEFINED": "Conexión indefinida",
"COMMITMENT_FLAG_FAILED": "Error al marcar el compromiso como procesado"
"COMMITMENT_FLAG_FAILED": "Error al marcar el compromiso como procesado",
"UNKNOWN": "Error desconocido de base de datos"
},
"CAPTCHA": {
"PARSE_ERROR": "Error al analizar el captcha",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Échec du marquage de la solution comme traitée",
"TABLES_UNDEFINED": "Tables non définies",
"CONNECTION_UNDEFINED": "Connexion non définie",
"COMMITMENT_FLAG_FAILED": "Échec du marquage de l'engagement comme traité"
"COMMITMENT_FLAG_FAILED": "Échec du marquage de l'engagement comme traité",
"UNKNOWN": "Erreur de base de données inconnue"
},
"CAPTCHA": {
"PARSE_ERROR": "Erreur d'analyse du captcha",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Impossibile contrassegnare la soluzione come elaborata",
"TABLES_UNDEFINED": "Tabelle indefinite",
"CONNECTION_UNDEFINED": "Connessione indefinita",
"COMMITMENT_FLAG_FAILED": "Impossibile contrassegnare l'impegno come elaborato"
"COMMITMENT_FLAG_FAILED": "Impossibile contrassegnare l'impegno come elaborato",
"UNKNOWN": "Errore database sconosciuto"
},
"CAPTCHA": {
"PARSE_ERROR": "Errore nell'analisi del captcha",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Falha ao marcar a solução como processada",
"TABLES_UNDEFINED": "Tabelas indefinidas",
"CONNECTION_UNDEFINED": "Conexão indefinida",
"COMMITMENT_FLAG_FAILED": "Falha ao marcar o compromisso como processado"
"COMMITMENT_FLAG_FAILED": "Falha ao marcar o compromisso como processado",
"UNKNOWN": "Erro de banco de dados desconhecido"
},
"CAPTCHA": {
"PARSE_ERROR": "Erro ao analisar o captcha",
Expand Down
3 changes: 2 additions & 1 deletion packages/locale/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"SOLUTION_FLAG_FAILED": "Falha ao marcar a solução como processada",
"TABLES_UNDEFINED": "Tabelas indefinidas",
"CONNECTION_UNDEFINED": "Conexão indefinida",
"COMMITMENT_FLAG_FAILED": "Falha ao marcar o compromisso como processado"
"COMMITMENT_FLAG_FAILED": "Falha ao marcar o compromisso como processado",
"UNKNOWN": "Erro de banco de dados desconhecido"
},
"CAPTCHA": {
"PARSE_ERROR": "Erro ao analisar o captcha",
Expand Down
8 changes: 6 additions & 2 deletions packages/provider/src/tasks/client/clientTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import { validateAddress } from "@polkadot/util-crypto/address";
import type { Logger } from "@prosopo/common";
import { type Logger, ProsopoApiError } from "@prosopo/common";
import { CaptchaDatabase, ClientDatabase } from "@prosopo/database";
import {
type IUserSettings,
Expand Down Expand Up @@ -191,7 +191,11 @@ export class ClientTaskManager {
},
);
} catch (e: unknown) {
this.logger.error(e);
const getClientListError = new ProsopoApiError("DATABASE.UNKNOWN", {
context: { error: e },
logger: this.logger,
});
this.logger.error(getClientListError, { context: { error: e } });
await this.providerDB.updateScheduledTaskStatus(
taskID,
ScheduledTaskStatus.Failed,
Expand Down

0 comments on commit aa37762

Please sign in to comment.