       console.log("git status error: #{line}")
 
     exitHandler = (code) ->
-      throw "git status exit: #{code}" unless code is 0
+      throw new Error("git status exit: #{code}") unless code is 0
       handler(conflicts)
 
     @process({

      stdout: (line) -> console.log line
      stderr: (line) -> console.log line
      exit: (code) ->
        throw "git checkout exit: #{code}" unless code is 0
        callback()
    })


      console.log("git status error: #{chunk}")

    exitHandler = (code) ->
      throw Error("git status exit: #{code}") unless code is 0
      handler(staged)

    @process({
