fix: uncaught error in http integration (#837)

This commit is contained in:
Alex Christoffer Rasmussen
2024-03-21 21:07:39 +01:00
committed by GitHub
parent fe30752130
commit c2280da61f
@@ -45,18 +45,13 @@ export class HttpIntegration implements IIntegration<HttpSubscription> {
} }
const parsedMessage = parseTemplateNested(message, state || {}); const parsedMessage = parseTemplateNested(message, state || {});
try { this.emit(parsedMessage);
const parsedUrl = new URL(parsedMessage);
this.emit(parsedUrl);
} catch (error) {
logger.error(LogOrigin.Tx, `HTTP Integration: ${error}`);
}
} }
} }
async emit(path: URL) { emit(path: string) {
await got.get(path, { got.get(path, { retry: { limit: 0 } }).catch((err) => {
retry: { limit: 0 }, logger.error(LogOrigin.Tx, `HTTP Integration: ${err.code}`);
}); });
} }