   request options, (error, response, body={}) ->
     if error? or response.statusCode isnt 200
       logError('Creating release failed', error, body)
-      callback(error ? response.statusCode)
+      callback(error ? new Error(response.statusCode))
     else
       callback()

  assetRequest = request options, (error, response, body='') ->
    if error? or response.statusCode >= 400
      logError('Upload release asset failed', error, body)
      callback(error ? response.statusCode)
    else
      callback(null, release)


    request options, (error, response, body='') ->
      if error? or response.statusCode isnt 204
        logError('Deleting existing release asset failed', error, body)
        callback(error ? new Error(response.statusCode))
      else
        callback()

