fix(#411): QA-008 — derive KNOWN_CODES from ERROR_MESSAGES keys
Eliminates manual duplication of AuthErrorCode values in KNOWN_CODES by deriving from Object.keys(ERROR_MESSAGES). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,15 +45,7 @@ const RETRYABLE_CODES: ReadonlySet<AuthErrorCode> = new Set<AuthErrorCode>([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
/** Set of recognised error code strings for fast membership testing. */
|
/** Set of recognised error code strings for fast membership testing. */
|
||||||
const KNOWN_CODES: ReadonlySet<string> = new Set<string>([
|
const KNOWN_CODES: ReadonlySet<string> = new Set<string>(Object.keys(ERROR_MESSAGES));
|
||||||
"access_denied",
|
|
||||||
"invalid_credentials",
|
|
||||||
"server_error",
|
|
||||||
"network_error",
|
|
||||||
"rate_limited",
|
|
||||||
"session_expired",
|
|
||||||
"unknown",
|
|
||||||
]);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type-guard: checks whether a string value is a known {@link AuthErrorCode}.
|
* Type-guard: checks whether a string value is a known {@link AuthErrorCode}.
|
||||||
|
|||||||
Reference in New Issue
Block a user