UNPKG

@454creative/easy-email

Version:

A framework-agnostic email service library for Node.js with observability and monitoring

69 lines 2.58 kB
/** * Custom error classes for email service */ export declare class EmailServiceError extends Error { code: string; details?: any; timestamp: Date; constructor(message: string, code: string, details?: any); } export declare class ConfigurationError extends EmailServiceError { constructor(message: string, details?: any); } export declare class ProviderError extends EmailServiceError { provider: string; constructor(message: string, provider: string, details?: any); } export declare class ValidationError extends EmailServiceError { constructor(message: string, details?: any); } export declare class TemplateError extends EmailServiceError { constructor(message: string, details?: any); } export declare class RetryError extends EmailServiceError { retryCount: number; maxRetries: number; constructor(message: string, retryCount: number, maxRetries: number, details?: any); } export declare class TimeoutError extends EmailServiceError { timeoutMs: number; constructor(message: string, timeoutMs: number, details?: any); } export declare class RateLimitError extends EmailServiceError { retryAfter: number | undefined; constructor(message: string, retryAfter?: number, details?: any); } export declare class AuthenticationError extends EmailServiceError { constructor(message: string, details?: any); } export declare class NetworkError extends EmailServiceError { statusCode: number | undefined; constructor(message: string, statusCode?: number, details?: any); } export declare class InvalidEmailError extends ValidationError { constructor(email: string, details?: any); } export declare class MissingRequiredFieldError extends ValidationError { constructor(field: string, details?: any); } export declare class InvalidTemplateError extends TemplateError { constructor(template: string, details?: any); } export declare class TemplateNotFoundError extends TemplateError { constructor(template: string, details?: any); } export declare class ConnectionError extends EmailServiceError { provider: string; constructor(message: string, provider: string, details?: any); } export declare class QuotaExceededError extends EmailServiceError { quota: string; limit: number; used: number; constructor(message: string, quota: string, limit: number, used: number, details?: any); } export declare class SpamDetectionError extends EmailServiceError { reason: string; constructor(message: string, reason: string, details?: any); } //# sourceMappingURL=index.d.ts.map