n8n/packages/nodes-base/nodes/Webhook/error.ts
Tomi Turtiainen 690138394f
refactor: Re-parent leaf error subclasses to UserError (no-changelog) (#32541)
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-06-24 10:00:16 +00:00

19 lines
435 B
TypeScript

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