aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-19 14:03:35 +0100
committerFlorian Dold <florian@dold.me>2023-02-19 14:03:35 +0100
commit925ef1f410e01323ee24ab9019afcc1713bf07c2 (patch)
tree6489fd2325148038e50368d927c5bd2ceb48f0c3
parentf4a651ef32ee96cbeae0a807c5b10fde8bdfa9f4 (diff)
taler-util: reject promise on node http error
-rw-r--r--packages/taler-util/src/http-impl.node.ts4
1 files 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
index 8f215e596..798b81e2d 100644
--- 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));
}