Skip to content

Commit 608b133

Browse files
committed
fix(http-client): silence bluebird warning (#62)
1 parent e726cef commit 608b133

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/http-client.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,15 @@ function applyInterceptors(input, interceptors, successName, errorName, ...inter
208208
let errorHandler = interceptor[errorName];
209209

210210
return chain.then(
211-
successHandler && (value => interceptor::successHandler(value, ...interceptorArgs)),
212-
errorHandler && (reason => interceptor::errorHandler(reason, ...interceptorArgs)));
211+
successHandler && (value => interceptor::successHandler(value, ...interceptorArgs)) || identity,
212+
errorHandler && (reason => interceptor::errorHandler(reason, ...interceptorArgs)) || thrower);
213213
}, Promise.resolve(input));
214214
}
215+
216+
function identity(x) {
217+
return x;
218+
}
219+
220+
function thrower(x) {
221+
throw x;
222+
}

0 commit comments

Comments
 (0)