grants-stack
grants-stack copied to clipboard
log and surface all errors to the user
Every time a user reports an issue, there's a lot of time and energy wasted doing guess work and asking users to screenshot the console, this shouldn't be needed.
We also have Sentry but it is noisy and some errors seem to be silenced.
The reason why the AlloError class was introduced is so that we can have a way to surface error to the user, but we haven't pushed hard enough to do this well.
For each business logic operation we do, we should:
- Ensure errors are caught, introduce an error boundary at the top, put thought into the error handling, they should be handled at the where it makes most sense, otherwise thrown to the parent
- Make sure errors are not silenced, remember errors are a good thing and very useful because they tell us what's wrong
- Differentiate between expected and unexpected errors
- All expected errors (transaction failure, indexer failure, network errors etc.) should be surfaced to the user UI, it is important that we do NOT leave users with a frozen UI and we give some kind of feedback
- All unexpected errors should be handled and logged to Sentry for review, we should surface an error to the user indicating that something unexpected happened.