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:
Jason Woltje
2026-02-16 13:40:48 -06:00
parent 752e839054
commit 08e32d42a3

View File

@@ -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}.