     deferred = Q.defer()
     @sync.buildActions(entry, existingEntry).update (error, response, body) =>
       @tickProgress()
-      if error
-        deferred.reject 'Error on updating inventory entry: ' + error
+      if error?
+        deferred.reject "Error on updating inventory entry: #{error}"
       else
         if response.statusCode is 200
           deferred.resolve 'Inventory entry updated.'

    entry =
      sku: sku
      quantityOnStock: parseInt(quantity)
    entry.expectedDelivery = expectedDelivery if expectedDelivery
    if channelId
      entry[CHANNEL_REF_NAME] =
        typeId: 'channel'
        id: channelId

    deferred = Q.defer()
    query = encodeURIComponent("key=\"#{channelKey}\"")
    rest.GET "/channels?where=#{query}", (error, response, body) ->
      if error?
        deferred.reject "Error on getting channel: #{error}"
      else if response.statusCode isnt 200
        humanReadable = JSON.stringify body, null, 2
        deferred.reject "Problem on getting channel: #{humanReadable}"
      else
        channels = body.results
        if _.size(channels) is 1
