How to handle uncaught errors?

15 views
Skip to first unread message

Foo JH

unread,
Sep 3, 2017, 1:30:49 AM9/3/17
to restify
It is not clear to me with the current version of restify how to handle runtime errors such as throw new Error(). I tried the following code but it did not catch:

server.on('uncaughtException', (req, res, route, err) => {
err.body = 'i caught it!';
res.send(500,err);
});

Can anyone advise?
Reply all
Reply to author
Forward
0 new messages