ReferenceErrors in domain error handler
Closed this issue · 4 comments
This block where we try to gracefully die refers to variables that don't exist:
https://github.com/amino/amino-gateway/blob/master/index.js#L23-L34
- no
server
- no
res
Looks like it's copy/pasted from the docs, but in the example there, those variables are in the outer scope.
Not sure we need to do anything other than cluster.worker.disconnect()
.
Thoughts?
whoops, I guess it fails silently due to the try/catch.
just reminds me how hopeless the whole domain/error event thing has become. At first glance I would need to create a new domain for every request, I'm not really down with that though.
typos aside, in practice I don't think domains have ever worked how I intended them to work. I have had luck with the trycatch API but (at least back then) the module did horrible things and I didn't want to be an accomplice.
At first glance I would need to create a new domain for every request
Yeah, if the goal would be to serve a 500 error, that's true.