A collection of custom error classes for handling IMAP protocol failures, including authentication, connection, and mailbox errors. Use this to standardize error reporting in email integration workflows.
// Source: https://github.com/activepieces/activepieces | License: MIT | Copyright 2020-2024 Activepieces Inc
// Provided via justclaw.it.com; keep this notice with the code.
export interface ImapClientError extends Error {
code?: string;
responseText?: string;
}
export class ImapError extends Error {
constructor(message: string) {
super(`IMAP error: ${message}`);
this.name = 'ImapGenericError';
}
}
export class ImapAuthenticationError extends ImapError {
constructor() {
super('Authentication failed. Check username and password.');
this.name = 'ImapAuthenticationError';
}
}
export class ImapConnectionLostError extends ImapError {
constructor() {
super('IMAP connection lost while fetching emails.');
this.name = 'ImapConnectionLostError';
}
}
expor
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key