From 7dcdc57e181f827f321f3b817403a86163f60d9e Mon Sep 17 00:00:00 2001 From: Juiced66 Date: Tue, 24 Sep 2024 15:47:11 +0200 Subject: [PATCH] fix: improve sendMessage error handling --- lib/messenger-clients/SMTPClient.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/messenger-clients/SMTPClient.ts b/lib/messenger-clients/SMTPClient.ts index f63db0f..b2b90a0 100644 --- a/lib/messenger-clients/SMTPClient.ts +++ b/lib/messenger-clients/SMTPClient.ts @@ -58,13 +58,7 @@ export class SMTPClient extends MessengerClient { try { await this.sendMessage(account, email); } catch (error) { - if (error.response) { - throw new ExternalServiceError( - "SMTP " + JSON.stringify(error.response.body) - ); - } - - throw new ExternalServiceError(error); + throw new ExternalServiceError(`SMTP: ${JSON.stringify(error)}`); } }