Upload error card shows the raw MatrixError string including the server URL #213

Closed
opened 2026-09-18 17:58:17 -04:00 by jared · 1 comment
Owner

Seen while verifying #172. When an upload fails permanently (e.g. 413) the upload card prints MatrixError: [413] nope (http://<homeserver>/_matrix/media/v3/upload?filename=upload.png) — the SDK's toString(), URL included.

Map the common cases to one sentence like the call-failure work in #160: 413 → "This file is larger than the server allows (limit N MB)." (the limit is in /_matrix/client/v1/media/config m.upload.size), 429 → "Slow down — try again in a moment.", 5xx/offline after retries → "Couldn't reach the server. Check your connection and retry.", anything else → the server's error text without the URL. Keep the raw string behind Developer Tools / console.

Seen while verifying #172. When an upload fails permanently (e.g. 413) the upload card prints `MatrixError: [413] nope (http://<homeserver>/_matrix/media/v3/upload?filename=upload.png)` — the SDK's `toString()`, URL included. Map the common cases to one sentence like the call-failure work in #160: 413 → "This file is larger than the server allows (limit N MB)." (the limit is in `/_matrix/client/v1/media/config` `m.upload.size`), 429 → "Slow down — try again in a moment.", 5xx/offline after retries → "Couldn't reach the server. Check your connection and retry.", anything else → the server's `error` text without the URL. Keep the raw string behind Developer Tools / console.
jared added the enhancementpriority: lowuxarea: media labels 2026-09-18 17:58:17 -04:00
Author
Owner

Fixed in 6df160a7: describeUploadError() maps the failure to one sentence — 413/M_TOO_LARGE → "This file is larger than the server allows (limit 52.4 MB)." (limit from m.upload.size when known), 429 → "Slow down — try again in a moment.", 401/403 → "The server refused this upload: ", 5xx/transport after the retry loop → "Couldn't reach the server. Check your connection and retry.", any other 4xx → the server's own sentence with the URL stripped. Both the full and compact upload cards use it; the raw MatrixError is still console.warn-ed for debugging. Unit-tested, and verified headless with routed 413 / 403 / 503 responses showing exactly those sentences on the card.

Fixed in `6df160a7`: `describeUploadError()` maps the failure to one sentence — 413/`M_TOO_LARGE` → "This file is larger than the server allows (limit 52.4 MB)." (limit from `m.upload.size` when known), 429 → "Slow down — try again in a moment.", 401/403 → "The server refused this upload: <server text>", 5xx/transport after the retry loop → "Couldn't reach the server. Check your connection and retry.", any other 4xx → the server's own sentence with the URL stripped. Both the full and compact upload cards use it; the raw MatrixError is still `console.warn`-ed for debugging. Unit-tested, and verified headless with routed 413 / 403 / 503 responses showing exactly those sentences on the card.
jared closed this issue 2026-09-19 12:40:58 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#213