n8n/packages/@n8n/imap/src/errors.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
659 B
TypeScript
Raw Normal View History

export abstract class ImapError extends Error {}
/** Error thrown when a connection attempt has timed out */
export class ConnectionTimeoutError extends ImapError {
constructor(
/** timeout in milliseconds that the connection waited before timing out */
readonly timeout?: number,
) {
let message = 'connection timed out';
if (timeout) {
message += `. timeout = ${timeout} ms`;
}
super(message);
}
}
export class ConnectionClosedError extends ImapError {
constructor() {
super('Connection closed unexpectedly');
}
}
export class ConnectionEndedError extends ImapError {
constructor() {
super('Connection ended unexpectedly');
}
}