n8n
Version:
n8n Workflow Automation Tool
32 lines (31 loc) • 920 B
TypeScript
import { ResponseError } from '../errors/response-errors/abstract/response.error';
export declare const enum HttpErrorKind {
responseError = "responseError",
userError = "userError",
unexpectedError = "unexpectedError",
httpError = "httpError",
serverError = "serverError"
}
export type HttpErrorDescriptor = {
kind: HttpErrorKind.responseError;
status: number;
message: string;
code: number;
hint?: string;
meta?: Record<string, unknown>;
} | {
kind: HttpErrorKind.userError;
message: string;
} | {
kind: HttpErrorKind.unexpectedError;
message: string;
} | {
kind: HttpErrorKind.httpError;
status: number;
message: string;
} | {
kind: HttpErrorKind.serverError;
message: string;
};
export declare function isResponseError(error: Error): error is ResponseError;
export declare function classifyHttpError(error: Error): HttpErrorDescriptor;