def unexpected_error(error)
      if @settings && @settings[:sensu][:global_error_handler]
        backtrace = error.backtrace.join("\n")
        if @logger
          @logger.warn("global catch-all error handling enabled")
          @logger.fatal("unexpected error - please address this immediately", {
            :error => error.to_s,
            :error_class => error.class,
            :backtrace => backtrace
          })
        else
          puts "global catch-all error handling enabled"
          puts "unexpected error - please address this immediately: #{error.to_s}\n#{error.class}\n#{backtrace}"
        end
      else
        raise error
      end
    end
def unexpected_error(error)
      if @settings && @settings[:sensu][:global_error_handler]
        backtrace = error.backtrace.join("\n")
        if @logger
          @logger.warn("global catch-all error handling enabled")
          @logger.fatal("unexpected error - please address this immediately", {
            :error => error.to_s,
            :error_class => error.class,
            :backtrace => backtrace
          })
        else
          puts "global catch-all error handling enabled"
          puts "unexpected error - please address this immediately: #{error.to_s}\n#{error.class}\n#{backtrace}"
        end
      else
        raise error
      end
    end
Initialize the Sensu process. Set the start time, initial
 service state, double the maximum number of EventMachine timers,
 set up the logger, and load settings. This method will load
 extensions and setup Sensu Spawn if the Sensu process is not the
 Sensu API. This method can and optionally daemonize the process
 and/or create a PID file.

 @param options [Hash]
 Handle an unexpected error. This method is used for EM global
 catch-all error handling, accepting an error object. Error
 handling is opt-in via a configuration option, e.g. `"sensu":
 {"global_error_handler": true}`. If a user does not opt-in, the
 provided error will be raised (uncaught). If a user opts-in via
 configuration, the error will be logged and ignored :itsfine:.

 @param error [Object]