mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
19 lines
453 B
TypeScript
19 lines
453 B
TypeScript
import { ApplicationError } from 'n8n-workflow';
|
|
|
|
export class ChatTriggerAuthorizationError 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);
|
|
}
|
|
}
|