"events.js:183 throw er; // Unhandled 'error' event"

Hi!

My meteor app is crashing because of this unhandled exception, throw by different kind of errors, none of them coming from meteor (we have a bad openLDAP server and bad SMTP).

my question is shouldn’t meteor handle this exception and prompting an error message instead of crashing the entire app???

have you tried try/catch ?

1 Like

yep, that’s the first thing I did, but it did’t work my guess is that this is happening asynchronous and why I can’t catch it

yes, then you should use async/await

const callSomeService = async () => {
  try {
    const result = await callService();
  } catch (error) {
    // do something
  }
}

Is this a production app? You can get this error if you’re using the wrong version of node.

1 Like

Thanks for the suggestion I’ll try it right away! :slight_smile:

I get the app to crash in development and in production, the only difference is that in development meteor restarted the app. My main concern is the in production app

$ meteor node --version
v8.9.3
$ node --version
v8.9.1

do you think this version difference matters??

What Meteor version is this?

meteor --version
Meteor 1.6.0.1

The correct versions are node 8.9.3 and npm 5.5.1

However, that doesn’t explain dev crashes.

yeah, I ran meteor node --version in the wrong directory, I do have node 8.9.3

I implemented your suggestion but I couldn’t catch any exception from events.js

so is this a bug? and if it is, is it node or Meteor bug?