n8n/packages/nodes-base/nodes/Webhook/error.ts
कारतोफ्फेलस्क्रिप्ट™ 6fb8a9ee39
ci: Fix linting issues (no-changelog) (#6788)
* ci: Fix linting (no-changelog)

* lintfix for nodes-base as well
2023-07-28 18:28:17 +02:00

17 lines
388 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);
}
}