Skip to content

Commit

Permalink
fix(http-client): silence bluebird warning (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanrsmith committed Jun 1, 2016
1 parent e726cef commit 608b133
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/http-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ function applyInterceptors(input, interceptors, successName, errorName, ...inter
let errorHandler = interceptor[errorName];

return chain.then(
successHandler && (value => interceptor::successHandler(value, ...interceptorArgs)),
errorHandler && (reason => interceptor::errorHandler(reason, ...interceptorArgs)));
successHandler && (value => interceptor::successHandler(value, ...interceptorArgs)) || identity,
errorHandler && (reason => interceptor::errorHandler(reason, ...interceptorArgs)) || thrower);
}, Promise.resolve(input));
}

function identity(x) {
return x;
}

function thrower(x) {
throw x;
}

0 comments on commit 608b133

Please sign in to comment.