pachli-android/core
Nik Clayton 5aacb02ea0
feat: Provide more detail in errors, especially media upload errors (#801)
Previous code assumed server responses would always be JSON, and had no
special handling for mis-configured servers that sometimes return HTML;
for example, if the server has a bug, or there's a reverse proxy in
front of the server issuing DoS-prevention challenges.

This could cause errors to show with no useful debugging information.

Update `ApiResult` to check the content-type in the response and return
one of two new errors if the content-type is missing or wrong. Also
include the HTTP code in `ApiResponse` for use elsewhere.

Update `ThrowableExtensions` to pull the `error` and optional
`description` out of the error body.

Update `PachliError` so `formatArgs` can be an array of arbitrary types,
not just strings.

Update `MediaUploader`; expose the different errors as new
`MediaUploaderError` types instead of `Exception` subclasses, and return
`Result<V, E>` where appropriate.

Update `ComposeViewModel` to use the new `MediaUploaderError` types and
create new `PickMediaError` to report issues there, replacing
`VideoOrImageException`.

Update `ComposeActivity` to use the new error types and show errors
until the user dismisses them, so they're better able to see and report
problems.

Fixes #704.
2024-07-04 19:16:24 +02:00
..
accounts fix: Ensure logging out accounts completes (#515) 2024-03-10 12:25:12 +01:00
activity refactor: Use androidx.core:core-splashscreen library (#766) 2024-06-19 16:27:49 +02:00
common feat: Provide more detail in errors, especially media upload errors (#801) 2024-07-04 19:16:24 +02:00
data feat: Show "Suggested accounts" (#734) 2024-06-17 21:43:12 +02:00
database refactor: Remove `TabData` type (#576) 2024-03-30 23:27:25 +01:00
designsystem fix: Ensure text in nav menu account header is legible (#773) 2024-06-22 16:55:57 +02:00
model refactor: Remove `TabData` type (#576) 2024-03-30 23:27:25 +01:00
navigation feat: Show "Suggested accounts" (#734) 2024-06-17 21:43:12 +02:00
network feat: Provide more detail in errors, especially media upload errors (#801) 2024-07-04 19:16:24 +02:00
network-test change: Move MediaUploadApi to the correct package 2024-04-30 16:23:34 +02:00
preferences refactor: Move CardViewMode to core.preferences (#729) 2024-06-10 16:28:55 +02:00
testing fix(deps): update dependency org.robolectric:robolectric to v4.12.2 (#707) 2024-06-18 14:30:17 +02:00
ui fix: Improve readability of status media labels (#778) 2024-06-25 11:53:47 +02:00
AndroidManifest.xml refactor: Start creating core modules (#286) 2023-12-04 16:58:36 +01:00