         .end()
         .then(-> chromedriver.kill())
         .then(chromedriverExit.then(
-          done,
-          (message) ->
-            jasmine.getEnv().currentSpec.fail(message)
+          ({errorCode, logs}) ->
+            if errorCode?
+              jasmine.getEnv().currentSpec.fail """
+                Chromedriver exited with code #{errorCode}.
+                Logs:\n#{logs.join("\n")}
+              """
             done()))
 
     client = buildAtomClient(args, env)
 
-    client.on "error", ({err, body}) ->
-      jasmine.getEnv().currentSpec.fail(err ? body.value.message)
+    client.on "error", ({body}) ->
+      jasmine.getEnv().currentSpec.fail(body)
       finish()
 
     fn(client.init()).then(finish)

    chromedriver.stderr.on "data", (log) ->
      logs.push(log.toString())
    chromedriver.stderr.on "close", ->
      if errorCode?
        reject("Chromedriver failed. Code: #{errorCode}. Logs: #{logs.join("\n")}")
      else
        resolve()

  waitsFor("webdriver to finish", (done) ->
    finish = once ->

    "--url-base=/wd/hub"
  ])

  chromedriverExit = new Promise (resolve) ->
    errorCode = null
    logs = []
    chromedriver.on "exit", (code, signal) ->
