         @gateblu.cleanup()
 
       process.on 'uncaughtException', (error) =>
-        console.error 'uncaughtException', error
+        console.error 'uncaughtException'
+        console.error error.message
+        console.error error.stack
         @gateblu.cleanup()
 
       @gateblu.on 'gateblu:config', (config) =>


    init()
      # send this back
    stopDevice: (device, callback=->) =>
      @gateblu.stopDevice device.uuid, callback
    startDevice: (device, callback=->) =>
      @gateblu.startDevice device, callback
    deleteDevice: (device, callback=->) =>
      @gateblu.deleteDevice device.uuid, device.token, callback
    stopDevices: (callback=->) =>
      @gateblu.stopDevices callback

    path          = require 'path'
    Gateblu       = require 'gateblu'

    init = =>
      config = configManager.loadConfig()
      unless config
        configManager.saveConfig()
        config = configManager.loadConfig()

