mail und logging

This commit is contained in:
Bastian Wagner
2026-07-17 11:50:12 +02:00
parent 201c4e03f8
commit edd88acd98
45 changed files with 1413 additions and 42 deletions

View File

@@ -0,0 +1,25 @@
export class PortalMailTemplateError extends Error {
constructor(
readonly templateName: string,
cause: unknown,
) {
super(`Mail template rendering failed for "${templateName}": ${errorMessage(cause)}`);
this.name = 'PortalMailTemplateError';
this.cause = cause;
}
}
export class PortalMailDeliveryError extends Error {
constructor(
readonly templateName: string,
cause: unknown,
) {
super(`Mail delivery failed for "${templateName}": ${errorMessage(cause)}`);
this.name = 'PortalMailDeliveryError';
this.cause = cause;
}
}
function errorMessage(error: unknown): string {
return error instanceof Error ? error.message : 'unknown error';
}