     options.password  = password  if password?
     options.vhost     = vhost     if vhost?
     options.heartbeat = heartbeat if heartbeat?
-    @connection       = amqp.createConnection options
+    options.autoReconnect = autoReconnect ? no
+    @connection = amqp.createConnection options
+    @connection.on "error", Worker.throwIt
     @connection.on "ready", =>
       @connection.exchange "workerExchange", @getWorkerExchangeOptions(), (exchange) =>
         @connection.queue "#{@worker.name}-#{@worker.hostname}-#{@worker.uuid}",

{exec}          = require "child_process"

class Worker extends EventEmitter

  constructor:(options = {},data)->
    options.name       or= "worker"

    durable     : true

  connect: ()->
    {host, port, protocol, login, password, vhost, heartbeat, autoReconnect} = @amqpOptions
    port              ?= 5672
    protocol          ?= 'amqp:'
    options           = {host, port, protocol} # but not vhost, because of a bug in node-amqp
