mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
17 lines
392 B
TypeScript
17 lines
392 B
TypeScript
|
export class ChatTriggerAuthorizationError 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);
|
||
|
}
|
||
|
}
|