fix(errors): set this.name in every domain error constructor (R6)

Spec reviewer caught a systemic gap during Task 6 (navigation) review:
Plan 8 left every feature's domain error class with a constructor that
didn't set this.name = '<ClassName>'. Plan 9 spec R6 requires it.

Fixed across all 10 error files:
- auth: AuthenticationError, UnauthenticatedError, UnauthorizedError, InputParseError
- blog: ArticleNotFoundError, InputParseError
- marketing-pages: PageNotFoundError, InputParseError
- navigation: HeaderNotFoundError, InputParseError
- media: MediaNotFoundError, InputParseError

Functionally a no-op — defineErrorMiddleware uses instanceof, not name —
but ensures correct serialization, stack traces, and JSON inspection.

Refactor log: §7
Spec: R6
This commit is contained in:
2026-05-06 15:33:28 +02:00
parent 27c79e6e1f
commit 9663c82624
10 changed files with 12 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
export class InputParseError extends Error {
constructor(message: string, options?: ErrorOptions) {
super(message, options);
this.name = "InputParseError";
}
}

View File

@@ -1,5 +1,6 @@
export class HeaderNotFoundError extends Error {
constructor(message = "Header not found", options?: ErrorOptions) {
super(message, options);
this.name = "HeaderNotFoundError";
}
}