This commit is contained in:
2025-05-23 19:03:44 +00:00
parent 7d28d23bbd
commit 1b141ec8f3
101 changed files with 30736 additions and 374 deletions

View File

@@ -34,6 +34,16 @@ export class EmailServiceError extends OperationError {
) {
super(message, EMAIL_SERVICE_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailServiceError)(
this.message,
context
);
}
}
/**
@@ -52,6 +62,16 @@ export class EmailTemplateError extends OperationError {
) {
super(message, EMAIL_TEMPLATE_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailTemplateError)(
this.message,
context
);
}
}
/**
@@ -70,6 +90,16 @@ export class EmailValidationError extends ValidationError {
) {
super(message, EMAIL_VALIDATION_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailValidationError)(
this.message,
context
);
}
}
/**
@@ -88,6 +118,16 @@ export class EmailSendError extends OperationError {
) {
super(message, EMAIL_SEND_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailSendError)(
this.message,
context
);
}
/**
* Creates an instance for a permanently failed send
@@ -161,6 +201,16 @@ export class EmailReceiveError extends OperationError {
) {
super(message, EMAIL_RECEIVE_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailReceiveError)(
this.message,
context
);
}
}
/**
@@ -256,6 +306,16 @@ export class EmailParseError extends OperationError {
) {
super(message, EMAIL_PARSE_ERROR, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailParseError)(
this.message,
context
);
}
}
/**
@@ -274,6 +334,16 @@ export class EmailRateLimitError extends ResourceError {
) {
super(message, EMAIL_RATE_LIMIT_EXCEEDED, context);
}
/**
* Creates a new instance with updated context
*/
protected createWithContext(context: IErrorContext): PlatformError {
return new (this.constructor as typeof EmailRateLimitError)(
this.message,
context
);
}
/**
* Creates an instance with rate limit information