Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Uncaught exception in Nodemon when application throws an exception #271

Open
matanster opened this Issue · 3 comments

2 participants

matanster Remy Sharp
matanster

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?

Remy Sharp
Owner

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);
Remy Sharp
Owner

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.

matanster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.