       expect(_.size(orders)).toBe 1
       expect(@distribution.masterClient._rest.GET).toHaveBeenCalledWith(/orders/, jasmine.any(Function))
       done()
-    .fail (msg) ->
-      console.error msg
-      done(msg)
+    .fail (err) ->
+      console.error err
+      done err
 
 describe '#getRetailerProductByMasterSKU', ->
   beforeEach ->

        ]
      expect(@distribution.masterClient._rest.POST).toHaveBeenCalledWith("/orders/x", JSON.stringify(expectedAction), jasmine.any(Function))
      done()
    .fail (msg) ->
      console.error msg
      done(msg)

      uri = "/product-projections/search?staged=true&lang=de&filter=variants.attributes.mastersku%3A%22foo%22"
      expect(@distribution.retailerClient._rest.GET).toHaveBeenCalledWith(uri, jasmine.any(Function))
      done()
    .fail (err) ->
      console.error err
      done err

describe '#addSyncInfo', ->
  beforeEach ->
