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:
@@ -1,17 +1,20 @@
|
||||
export class AuthenticationError extends Error {
|
||||
constructor(message: string, options?: ErrorOptions) {
|
||||
super(message, options);
|
||||
this.name = "AuthenticationError";
|
||||
}
|
||||
}
|
||||
|
||||
export class UnauthenticatedError extends Error {
|
||||
constructor(message: string, options?: ErrorOptions) {
|
||||
super(message, options);
|
||||
this.name = "UnauthenticatedError";
|
||||
}
|
||||
}
|
||||
|
||||
export class UnauthorizedError extends Error {
|
||||
constructor(message: string, options?: ErrorOptions) {
|
||||
super(message, options);
|
||||
this.name = "UnauthorizedError";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export class InputParseError extends Error {
|
||||
constructor(message: string, options?: ErrorOptions) {
|
||||
super(message, options);
|
||||
this.name = "InputParseError";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user