#41 Better error handling
Opened 6 years ago by amitosh. Modified 6 years ago

In some places, we do not perform any error handling. The app silently fails to load any data without any feedback. We should design a standard pattern to report errors to the user.

  • When data fetching fails due to the user being offline.
  • Unexpected HTTP responses.
  • Errors due to the user not granting proper permissions (Android 6+).
  • Any other error.

Very true. It gives a feeling that we're stuck in the app.
1. I have an idea of showing an error screen saying that "your internet connection is lost. Try Again."(Provide this CTA to reload).
2. For error from our end, we can show "Oops, something went wrong. Take me back."

I will come up with screens eventually.

@amitosh, Yeah it will be nice to handle error. First we need to figure out what all errors can come up, because sometimes few errors are handled by Android itself.

I have covered three types of errors here:
1. Errors due to incorrect page URL etc.
2. Errors due to problems from our end.
3. Errors (most common) due to lost connection.

error_handling.jpg

Yeah it will be nice to handle error. First we need to figure out what all errors can come up, because sometimes few errors are handled by Android itself.

I have added a list to the PR description. These are the errors we are currently silently swallowing. It's unlikely that there will be any error that don't fall into the lists.

For unexpected error, we can add a generic error handler like: "Oh no! Something broke :("

@amitosh @a2batic

I was going through some articles for this issue. I particularly liked this article
https://usersnap.com/blog/error-messages-best-practices/

These are some guidelines for handling errors by material (Android). They cover aspects pertaining to android errors.

Errors occur when an app fails to complete an action, such as:
- The app does not understand user input
- The system or app fails
- A user intends to run incompatible operations concurrently
- Minimize errors by designing apps that make it easy for users to input information flexibly. Apps should accept common data formats that use affordances to improve user understanding.

To address errors:
- Clearly communicate what is happening
- Describe how a user can resolve it
- Preserve as much user-entered input as possible

There are three types of errors:
- User input errors
- App errors
- Incompatible state errors

Source

Yeah it will be nice to handle error. First we need to figure out what all errors can come up, because sometimes few errors are handled by Android itself.

I have added a list to the PR description. These are the errors we are currently silently swallowing. It's unlikely that there will be any error that don't fall into the lists.

Can you paste the link of description here ?

For unexpected error, we can add a generic error handler like: "Oh no! Something broke :("

+1

Login to comment on this ticket.

Metadata
Attachments 1
Attached 6 years ago View Comment