```coffeescript
Client = require('raven').Client

Client.prototype.captureDocumentError = (req, err) ->
  @captureMessage "#{req.type}: #{err.details[0].message}",
    level: 'warning'
    extra: req: req, err: err

module.exports = new Client process.env.SENTRY_DNS

module.exports.patchGlobal (id, err) ->
  console.error 'Uncaught Exception'
  console.error err.message
  console.error err.stack
  process.exit 1

```

Disable logging to Sentry in development
user
```coffeescript
Client = require('raven').Client

Client.prototype.captureDocumentError = (req, err) ->
  @captureMessage "#{req.type}: #{err.details[0].message}",
    level: 'warning'
    extra: req: req, err: err

module.exports = new Client process.env.SENTRY_DNS

if process.env.NODE_ENV isnt 'development'
  module.exports.patchGlobal (id, err) ->
    console.error 'Uncaught Exception'
    console.error err.message
    console.error err.stack
    process.exit 1

```
assistant