We can divide errors broadly into two types, and error handling into two aspects.
The two error types:
- Render errors
The two aspects of error handling:
- Displaying information to the user
- Providing information to the developer
In general, you want to show only the minimum amount of error information to users, and you want to reveal the maximum amount of information to developers, both at development time and at other times like test and production.
(derived from the example found in the ). You might also find it useful to check out of error boundaries in React 16.
Copyright © 2021 IDG Communications, Inc.