 eco = require 'eco'
 checkIdent = require 'ident-express'
 request = require 'request'
-{Exceptional} = require 'exceptional-node'
 
 {User} = require 'model/user'
 {Dataset} = require 'model/dataset'

if /staging|production/.test process.env.NODE_ENV
  process.on 'uncaughtException', (err) ->
    console.warn err
    Exceptional.handle err
    setTimeout ->
      process.kill process.pid, 'SIGTERM'
    , 500

# Doesn't seem to do much.
mongoose.connection.on 'error', (err) ->
  console.warn "MONGOOSE CONNECTION ERROR #{err}"

if /production/.test process.env.NODE_ENV
  na.initialize 'UA-21451224-7', 'scraperwiki.com'
