Class: EmailError
Defined in: src/types/errors.ts:691
Email delivery error.
Remarks
Thrown when email delivery fails via SMTP or other email services.
Example
throw new EmailError(
'Failed to send approval email',
'user@example.com'
);
Extends
Constructors
new EmailError()
new EmailError(
message,recipient?,cause?):EmailError
Defined in: src/types/errors.ts:706
Creates a new EmailError.
Parameters
message
string
Description of the email failure
recipient?
string
Email recipient address
cause?
Error
Original error (if chained)
Returns
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: src/types/errors.ts:71
Original error that caused this error (if any).
Remarks
Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.
Example
try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}
Inherited from
code
readonlycode:"EMAIL_ERROR"='EMAIL_ERROR'
Defined in: src/types/errors.ts:692
Machine-readable error code.
Remarks
Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).
Overrides
recipient?
readonlyoptionalrecipient:string
Defined in: src/types/errors.ts:697
Email recipient address (if applicable).