n8n/packages/nodes-base/nodes/Webhook/error.ts
2023-07-04 16:17:50 +02:00

14 lines
380 B
TypeScript

export class WebhookAuthorizationError extends Error {
constructor(readonly responseCode: number, message?: string) {
if (message === undefined) {
message = 'Authorization problem!';
if (responseCode === 401) {
message = 'Authorization is required!';
} else if (responseCode === 403) {
message = 'Authorization data is wrong!';
}
}
super(message);
}
}