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 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
752e839054
commit
08e32d42a3
@@ -45,15 +45,7 @@ const RETRYABLE_CODES: ReadonlySet<AuthErrorCode> = new Set<AuthErrorCode>([
|
||||
]);
|
||||
|
||||
/** Set of recognised error code strings for fast membership testing. */
|
||||
const KNOWN_CODES: ReadonlySet<string> = new Set<string>([
|
||||
"access_denied",
|
||||
"invalid_credentials",
|
||||
"server_error",
|
||||
"network_error",
|
||||
"rate_limited",
|
||||
"session_expired",
|
||||
"unknown",
|
||||
]);
|
||||
const KNOWN_CODES: ReadonlySet<string> = new Set<string>(Object.keys(ERROR_MESSAGES));
|
||||
|
||||
/**
|
||||
* Type-guard: checks whether a string value is a known {@link AuthErrorCode}.
|
||||
|
||||
Reference in New Issue
Block a user