29 lines
1001 B
TypeScript
29 lines
1001 B
TypeScript
/**
|
|
* 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;
|
|
}
|