From 3a4b3418fe3c4fe4b8fec9067b31d8ead682c64c Mon Sep 17 00:00:00 2001 From: Sam Vargas Date: Thu, 8 Oct 2026 15:57:08 +0100 Subject: [PATCH] [BY-3684]: type HttpError.status as number | undefined status is absent when the request never got a response, but the generated d.ts declared number. Consumers surface the error via e.status ?? e.body?.statusCode ?? 500 and need the type to reflect that. --- lib/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/index.js b/lib/index.js index 5af27a5..7ba8cd9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -24,6 +24,7 @@ export class HttpError extends Error { constructor (message, body, status) { super(message) this.body = body + /** @type {number | undefined} HTTP status code, absent when the request never got a response */ this.status = status /** @type {{ method: string, url: string } | undefined} The request that failed */ this.request = undefined