refactor(frontend): extract extractErrorCode() helper to eliminate repeated type assertions #649

Merged
marcel merged 5 commits from feat/issue-113-extract-error-code into main 2026-05-21 09:31:54 +02:00

5 Commits

Author SHA1 Message Date
Marcel
f4cc4d6c20 fix(frontend): add extractErrorCode to all api.server vi.mock factories
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m24s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m19s
CI / fail2ban Regex (pull_request) Successful in 41s
CI / Semgrep Security Scan (pull_request) Successful in 21s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m2s
All route spec files that mock $lib/shared/api.server were missing
extractErrorCode from the mock factory, causing a vitest "No export defined"
error after the refactor introduced the new export.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:17:54 +02:00
Marcel
eb69135f2c refactor(frontend): drop unused message field from ApiError interface
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m11s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m22s
CI / fail2ban Regex (pull_request) Successful in 41s
CI / Semgrep Security Scan (pull_request) Successful in 20s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m1s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 23:03:35 +02:00
Marcel
4edd2461d1 refactor(frontend): replace all as-unknown-as error casts with extractErrorCode
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m17s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m27s
CI / fail2ban Regex (pull_request) Successful in 41s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m0s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 22:55:33 +02:00
Marcel
fc9a02a6a0 refactor(frontend): add ApiError interface and extractErrorCode helper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 22:55:00 +02:00
Marcel
6607ad9104 test(frontend): add unit spec for extractErrorCode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 22:55:00 +02:00