commit 925ef1f410e01323ee24ab9019afcc1713bf07c2
parent f4a651ef32ee96cbeae0a807c5b10fde8bdfa9f4
Author: Florian Dold <florian@dold.me>
Date: Sun, 19 Feb 2023 14:03:35 +0100
taler-util: reject promise on node http error
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/packages/taler-util/src/http-impl.node.ts b/packages/taler-util/src/http-impl.node.ts
@@ -170,6 +170,10 @@ export class HttpLibImpl implements HttpRequestLibrary {
throw new Error(`unsupported protocol ${options.protocol}`);
}
+ req.on("error", (e: Error) => {
+ reject(e);
+ });
+
if (reqBody) {
req.write(new Uint8Array(reqBody));
}