Skip to content

feat(web): humanize pre-scan upload and credential errors#414

Merged
haksungjang merged 1 commit into
mainfrom
feat/humanize-upload-errors
Jul 16, 2026
Merged

feat(web): humanize pre-scan upload and credential errors#414
haksungjang merged 1 commit into
mainfrom
feat/humanize-upload-errors

Conversation

@haksungjang

Copy link
Copy Markdown
Member

Why

A failed upload or token stash on the New scan form showed (e as Error).message verbatim — the server's raw error string, an HTTP status, or the browser's "Failed to fetch". For the non-developer audience this reads as a malfunction with no next step.

What

  • api.ts: /upload and /git-cred clients now throw a typed ApiError carrying the HTTP status; added a pure describeUploadError() mapper.
  • Four situation-specific messages (en + ko): file too large (413), server unreachable (fetch TypeError), server error (5xx/unknown), rejected input (other 4xx).
  • The raw server/browser text is demoted to muted fine print under the headline (useful for bug reports); 413 shows no raw detail at all.
  • Unit tests for the mapper and the ApiError contract; the upload e2e spec now asserts the humanized headline and the absence of raw server text.

Verification

  • tsc --noEmit, vitest 216/216, i18n coverage en ≡ ko (530 keys), token lint — pass
  • playwright test tests/ui/upload.spec.ts — 2/2 pass

The scan form surfaced raw exception text on a failed upload or token
stash: the server's literal error string, an HTTP status, or the
browser's "Failed to fetch". A non-developer gets no usable guidance
from any of those.

Carry the HTTP status on a typed ApiError from the /upload and
/git-cred clients, map failures to four situation-specific messages
(too large, unreachable server, server error, rejected input) in both
locales, and keep the raw server text as muted fine print for bug
reports instead of the headline. 413 drops the redundant detail line
entirely.

The upload e2e spec now asserts the humanized headline is shown and
the raw server text is not.
@haksungjang
haksungjang merged commit 2dc4384 into main Jul 16, 2026
35 checks passed
@haksungjang
haksungjang deleted the feat/humanize-upload-errors branch July 16, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant