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
21 lines
540 B
TypeScript
21 lines
540 B
TypeScript
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";
|
|
}
|
|
}
|