19 lines
660 B
TypeScript
19 lines
660 B
TypeScript
import type { IDomainError, CommonDomainErrorKind } from '@gridpilot/shared/errors';
|
|
|
|
/**
|
|
* Domain Error: NotificationDomainError
|
|
*
|
|
* Implements the shared IDomainError contract for notification domain failures.
|
|
*/
|
|
export class NotificationDomainError extends Error implements IDomainError<CommonDomainErrorKind> {
|
|
readonly name = 'NotificationDomainError';
|
|
readonly type = 'domain' as const;
|
|
readonly context = 'notifications';
|
|
readonly kind: CommonDomainErrorKind;
|
|
|
|
constructor(message: string, kind: CommonDomainErrorKind = 'validation') {
|
|
super(message);
|
|
this.kind = kind;
|
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
}
|
|
} |