0

I'm working on a NodeJs project. I come across with a thought that how can I differentiate an error occur in operational process (for example: system is out of memory) from a programmer error (for example: syntax error)

Does anyone have a tip for this?

Thanks for any suggestion.

2
  • Syntax errors that are not immediately observable when starting the application would be treated the same as operational errors, wouldn't they? Commented Mar 24, 2017 at 4:01
  • Every uncaught operational error is a programmer mistake :-) Commented Mar 24, 2017 at 4:01

1 Answer 1

1

If you use something like process.on('uncaughtException', (err) => {throw err}) it will catch and throw any uncaught errors in your code.
Also, have a look at this for more information: https://www.joyent.com/node-js/production/design/errors

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.