You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ApiRequestException can 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 showErrorDialog and make sure those use this logic where appropriate; and search for TODO comments referring to this issue, and resolve those.
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 callshowErrorDialog
with something likee.toString()
, wheree
is just the exception we caught.This issue is to
ApiRequestException
can look like, so that we're making explicit choices about what the error message looks like in each case;showErrorDialog
and make sure those use this logic where appropriate; and search forTODO
comments referring to this issue, and resolve those.Related issues, which may overlap with this one:
The text was updated successfully, but these errors were encountered: