How to use the level.errors function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github proofofexistence / proofofexistence / lib / server.js View on Github external
.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))
      }
    })
}