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 || {});
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}`);
});
}