taler-util: reject promise on node http error

This commit is contained in:
Florian Dold 2023-02-19 14:03:35 +01:00
parent f4a651ef32
commit 925ef1f410
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -170,6 +170,10 @@ export class HttpLibImpl implements HttpRequestLibrary {
throw new Error(`unsupported protocol ${options.protocol}`); throw new Error(`unsupported protocol ${options.protocol}`);
} }
req.on("error", (e: Error) => {
reject(e);
});
if (reqBody) { if (reqBody) {
req.write(new Uint8Array(reqBody)); req.write(new Uint8Array(reqBody));
} }