From c4fb8e53289a3ef6f03f973a2c213e765dee5889 Mon Sep 17 00:00:00 2001 From: Dmitry Filatov Date: Sun, 7 May 2023 23:12:33 +0300 Subject: [PATCH] fix: update error definitions --- types/errors.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/errors.d.ts b/types/errors.d.ts index fd2ce7c3a99..7540d75c40e 100644 --- a/types/errors.d.ts +++ b/types/errors.d.ts @@ -4,7 +4,10 @@ import Client from './client' export default Errors declare namespace Errors { - export class UndiciError extends Error { } + export class UndiciError extends Error { + name: 'UndiciError'; + code: 'UND_ERR'; + } /** Connect timeout error. */ export class ConnectTimeoutError extends UndiciError { @@ -31,6 +34,12 @@ declare namespace Errors { } export class ResponseStatusCodeError extends UndiciError { + constructor ( + message: string, + statusCode: number, + headers: IncomingHttpHeaders | string[] | null, + body?: null | Record | string + ); name: 'ResponseStatusCodeError'; code: 'UND_ERR_RESPONSE_STATUS_CODE'; body: null | Record | string