Node.js · Middle · Question 24 of 75
What is the difference between operational errors and programmer errors?
- ✓Correct answer: Operational errors are expected failures (network down, invalid input); programmer errors are bugs (undefined is not a function)
- 2Operational errors come from the OS, programmer errors come from npm
- 3There is no difference in how they should be handled
Explanation
Operational errors should be handled: retry, return 4xx/5xx, log. Bugs should be fixed; after an unexpected exception the safest move is often to restart the process.