Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch(error => {
if (error instanceof level.errors.NotFoundError) {
res.json({
'success': false,
'reason': 'nonexistent'
})
} else {
console.log(error, error.stack)
res.status(500).end('Unexpected remote error: ' + JSON.stringify(error))
}
})
}