Reputation: 10485
Is it possible to throw an exception outside a try
block? If I'm not mistaken in Java
you can declare that a function throws
an exception and then just throw it up the function chain, with no try/catch
inside the function. Any similar method in nodeJS
?
Also, I noticed that if I try to throw an exception from a callback function to where It was called in my code, I can't do it. I understand it can be solved using domains
, which I still don't know. Am I right?
Thanks!
Upvotes: 0
Views: 3147