- 2.1 Use Async-Await or promises for async error handling
- 2.2 Use only the built-in Error object
- 2.3 Distinguish operational vs programmer errors
- 2.4 Handle errors centrally, not within a middleware
- 2.5 Document API errors using Swagger or GraphQL
- 2.6 Exit the process gracefully when a stranger comes to town
- 2.7 Use a mature logger to increase error visibility
- 2.8 Test error flows using your favorite test framework
- 2.9 Discover errors and downtime using APM products
- 2.10 Catch unhandled promise rejections
- 2.11 Fail fast, validate arguments using a dedicated library
- 2.12 Always await promises before returning to avoid a partial stacktrace
当前内容版权归 goldbergyoni 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 goldbergyoni .