diff --git a/back/src/domains/core/notifications/adapters/BrevoNotificationGateway.ts b/back/src/domains/core/notifications/adapters/BrevoNotificationGateway.ts index b8651f3a2b..caeab0da73 100644 --- a/back/src/domains/core/notifications/adapters/BrevoNotificationGateway.ts +++ b/back/src/domains/core/notifications/adapters/BrevoNotificationGateway.ts @@ -11,6 +11,7 @@ import { NotificationId, type TemplatedEmail, type TemplatedSms, + castError, emailTemplatesByName, errors, smsTemplatesByName, @@ -23,6 +24,7 @@ import { counterSendTransactEmailTotal, } from "../../../../utils/counters"; import { createLogger } from "../../../../utils/logger"; +import { notifyObjectDiscord } from "../../../../utils/notifyDiscord"; import { NotificationGateway } from "../ports/NotificationGateway"; import { BrevoNotificationGatewayRoutes } from "./BrevoNotificationGateway.routes"; import { @@ -165,11 +167,16 @@ export class BrevoNotificationGateway implements NotificationGateway { }), ) .catch((error) => { + const castedError = castError(error); logger.error({ notificationId, - error, + error: castedError, message: "sendTransactSmsError", }); + notifyObjectDiscord({ + _message: "Error send sms", + ...castedError, + }); throw error; }); }