Skip to content

Commit

Permalink
including additional info in StreamApiError
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhoff committed Jan 23, 2018
1 parent 3a9b9eb commit 0ec8906
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/client.js
Expand Up @@ -155,10 +155,11 @@ StreamClient.prototype = {

var callback = this.wrapCallback(cb);
return function task(error, response, body) {
// console.log(error);
if (error) {
reject(new errors.StreamApiError("Unexpected API response", body, response));
reject(new errors.StreamApiError(`${error}`, body, response));
} else if (!/^2/.test('' + response.statusCode)) {
reject(new errors.StreamApiError("Unexpected API response", body, response));
reject(new errors.StreamApiError(`${error}`, body, response));
} else {
fulfill(body);
}
Expand Down

0 comments on commit 0ec8906

Please sign in to comment.