-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If error is thrown but no 'catch' is defined then nothing happens #5
Comments
See nodejs/node#830. |
@derhuerst because the catch could be attached at a later time. |
We would have to determine whether the step system has a handler attached or not, at runtime. When a step is invoked, if there is no handler attached, it will throw an error, and potentially cause an issue within a users application, and must be documented thoroughly. I much prefer to keep the error until a handler is attached and invoke upon attachment, to ensure that the user's application runs without issue. A warning that no handler is attached on uncaught error seems like a reasonable solution. |
Yes a warning sound like the best idea |
If an error is thrown and it's not being handled anywhere, my expectation would be to have the application bail with an |
Let's say that I have this code:
If I run this I won't get any error or message saying that
nonDeclaredVar
has not been declared, actually I won't get any messages at all, the program will just exit silently.However if I specify a
catch
like this:Then I will get
something happened
printed to the console, which is what I expect would happen.I think that if there isn't an error handler then the error should be allowed to bubble up.
What do you think? Is there any reason for not doing anything when an error is thrown and no catch is specified?
The text was updated successfully, but these errors were encountered: