Update
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-27 23:28:43 +02:00
parent 21015757bd
commit c76a746cd7
39 changed files with 3268 additions and 519 deletions
+25
View File
@@ -0,0 +1,25 @@
const PASSTHROUGH_CODES = new Set([
'INVALID_CREDENTIALS',
'LOGIN_RATE_LIMITED',
'GUEST_ACCESS_DISABLED',
'GUEST_READ_ONLY',
'GUEST_PROJECT_SCOPE_REQUIRED',
])
export function formatAuthError(error: unknown, fallback: string): string {
if (!(error instanceof Error)) return fallback
const code = (error as { code?: string }).code
if (code && PASSTHROUGH_CODES.has(code)) return error.message
if (
code === 'REQUEST_ERROR'
|| code === 'INTERNAL_ERROR'
|| code === 'SESSION_CREATION_FAILED'
|| /request failed|failed to fetch|networkerror/i.test(error.message)
) {
return fallback
}
return error.message || fallback
}