pachli-android/app
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
..
src feat: Provide more detail in errors, especially media upload errors (#801) 2024-07-04 19:16:24 +02:00
build.gradle.kts feat: Warn the user if the posting language might be incorrect (#792) 2024-07-02 20:22:17 +02:00
gitTools.gradle ci: Upload orangeRelease to Google Play (internal track) (#134) 2023-09-28 13:50:02 +02:00
lint-baseline.xml feat: Provide more detail in errors, especially media upload errors (#801) 2024-07-04 19:16:24 +02:00
lint.xml change: Disable SyntheticAccessor lint rule (#424) 2024-02-06 19:51:37 +01:00
proguard-rules.pro refactor: Remove `TabData` type (#576) 2024-03-30 23:27:25 +01:00