How do I get sentry to work with restify and catch uncaught errors?

Hi I’m trying to get sentry to work with restify version 6.3.4 and catch all uncaught exceptions.

I tried:

Sentry.init({ dsn: config.SENTRY_DSN });

const server = restify.createServer({ handleUncaughtExceptions: true });
server.on('uncaughtException', function(req, res, route, err) {	

But I believe this feature was depricated from restify.