Files
n8n/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/error.ts
T
Tomi Turtiainenandlinear-code[bot] 185f3f229a refactor(core): Replace deprecated ApplicationError in nodes-langchain (no-changelog) (#32471)
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-06-18 07:35:09 +00:00

19 lines
439 B
TypeScript

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