Skip to content

Commit

Permalink
fix: update error definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
dfilatov committed May 7, 2023
1 parent 790b35d commit c4fb8e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion types/errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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, any> | string
);
name: 'ResponseStatusCodeError';
code: 'UND_ERR_RESPONSE_STATUS_CODE';
body: null | Record<string, any> | string
Expand Down

0 comments on commit c4fb8e5

Please sign in to comment.