Files
smartmta/dist_ts/mail/delivery/smtpclient/error-handler.d.ts

29 lines
1001 B
TypeScript
Raw Normal View History

2026-02-10 15:54:09 +00:00
/**
* SMTP Client Error Handler
* Error classification and recovery strategies
*/
import { SmtpErrorType } from './constants.js';
import type { ISmtpResponse, ISmtpErrorContext, ISmtpClientOptions } from './interfaces.js';
export declare class SmtpErrorHandler {
private options;
constructor(options: ISmtpClientOptions);
/**
* Classify error type based on response or error
*/
classifyError(error: Error | ISmtpResponse, context?: ISmtpErrorContext): SmtpErrorType;
/**
* Determine if error is retryable
*/
isRetryable(errorType: SmtpErrorType, response?: ISmtpResponse): boolean;
/**
* Get retry delay for error type
*/
getRetryDelay(attempt: number, errorType: SmtpErrorType): number;
/**
* Create enhanced error with context
*/
createError(message: string, errorType: SmtpErrorType, context?: ISmtpErrorContext, originalError?: Error): Error;
private classifyErrorByMessage;
private classifyErrorByCode;
}