1
0
Fork 0
mirror of https://github.com/n8n-io/n8n.git synced 2025-02-21 02:56:40 -08:00
n8n/packages/nodes-base/nodes/Webhook/error.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
449 B
TypeScript
Raw Normal View History

import { ApplicationError } from 'n8n-workflow';
export class WebhookAuthorizationError extends ApplicationError {
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);
}
}