From c2280da61fbdb4ff6e4170efc83d66f5864ccf72 Mon Sep 17 00:00:00 2001 From: Alex Christoffer Rasmussen Date: Thu, 21 Mar 2024 21:07:39 +0100 Subject: [PATCH] fix: uncaught error in http integration (#837) --- .../services/integration-service/HttpIntegration.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/server/src/services/integration-service/HttpIntegration.ts b/apps/server/src/services/integration-service/HttpIntegration.ts index 906702f6e..4be8ba442 100644 --- a/apps/server/src/services/integration-service/HttpIntegration.ts +++ b/apps/server/src/services/integration-service/HttpIntegration.ts @@ -45,18 +45,13 @@ export class HttpIntegration implements IIntegration { } const parsedMessage = parseTemplateNested(message, state || {}); - try { - const parsedUrl = new URL(parsedMessage); - this.emit(parsedUrl); - } catch (error) { - logger.error(LogOrigin.Tx, `HTTP Integration: ${error}`); - } + this.emit(parsedMessage); } } - async emit(path: URL) { - await got.get(path, { - retry: { limit: 0 }, + emit(path: string) { + got.get(path, { retry: { limit: 0 } }).catch((err) => { + logger.error(LogOrigin.Tx, `HTTP Integration: ${err.code}`); }); }