-
Notifications
You must be signed in to change notification settings - Fork 350
Description
When the user tries to do something that calls for an API request, and the request fails, we should show them an error dialog with a useful error message.
In some cases we'll have specific logic to interpret the error, but in general we should show them (a) the error message the server sent, if we got one; (b) if we weren't even able to complete the HTTP request, then whatever error message we got from the system about that (via our NetworkException type).
We already do this in a lot of places, in particular on the various actions the user can choose from the message action sheet (in lib/widgets/action_sheet.dart). But in other places we call showErrorDialog with something like e.toString(), where e is just the exception we caught.
This issue is to
- factor that logic out in a clean way, to the extent it's reusable (which a lot of it is);
- test that factored-out code for all the different cases of what an
ApiRequestExceptioncan look like, so that we're making explicit choices about what the error message looks like in each case; - use that logic consistently. In particular, search for call sites of
showErrorDialogand make sure those use this logic where appropriate; and search forTODOcomments referring to this issue, and resolve those.
Related issues, which may overlap with this one:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status