Skip to content

Commit

Permalink
send discord notification on send sms fail
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Sep 11, 2024
1 parent 2beef52 commit 752dfad
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
NotificationId,
type TemplatedEmail,
type TemplatedSms,
castError,
emailTemplatesByName,
errors,
smsTemplatesByName,
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
});
}
Expand Down

0 comments on commit 752dfad

Please sign in to comment.