Uncaught exception in Nodemon when application throws an exception #271

Open
matanster opened this Issue Jan 19, 2014 · 3 comments

Comments

2 participants

During developing, I throw an exception (a bit dirty I know, but the purpose is to halt my server if this happened, so I can address the issue).

    throw "stop my app";
    ^
stop my app

Circumstantially, after my app throws this, it seems that nodemon crashes as well:
Clearly coming from this nodemon source file

exception in nodemon killing node
Error: read ECONNRESET
    at errnoException (net.js:901:11)
    at Pipe.onread (net.js:556:19)

If appropriate, please file an error: http://github.com/remy/nodemon/issues/new

I think nodemon shouldn't crash though.. but rather emit it's standard [nodemon] app crashed - waiting for file changes before starting... message and wait for app changes. If it does crash, can it produce some more context about the crash, so I can consider making a pull request?

Owner

remy commented Jan 19, 2014

Hmm. Yeah, that sounds right. Happy to take a pull request. It'll run through Travis tests, and there's a bunch of restart checks in there. It might be worth adding to the tests (I'd add something in test/fork/ if I were you).

Can you pop a simple example of what you're doing, or is it just something like?

setTimeout(function () {
  throw new Error("stop my app");
}, 1000);
Owner

remy commented Jan 19, 2014

In fact, I do have a test that has something similar: https://github.com/remy/nodemon/blob/master/test/monitor/run.test.js#L23 so maybe seeing what you're doing would be useful too.

I'll try to reproduce or find the difference but currently I am facing
larger problems in
flatiron/winston#288 (comment).
Maybe this was specific to using Winston with certain flags.

On Sun, Jan 19, 2014 at 7:03 PM, Remy Sharp notifications@github.comwrote:

In fact, I do have a test that has something similar:
https://github.com/remy/nodemon/blob/master/test/monitor/run.test.js#L23so maybe seeing what you're doing would be useful too.


Reply to this email directly or view it on GitHubhttps://github.com/remy/nodemon/issues/271#issuecomment-32713098
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment