diff --git a/lib/interceptor/response-error.js b/lib/interceptor/response-error.js index 546ed53a0b3..6d29c17bce8 100644 --- a/lib/interceptor/response-error.js +++ b/lib/interceptor/response-error.js @@ -78,5 +78,5 @@ class Handler extends DecoratorHandler { } } -module.exports = (dispatch) => (opts, handler) => - dispatch(opts, new Handler(opts, { handler })) +module.exports = (dispatch) => (opts, handler) => opts.throwOnError ? + dispatch(opts, new Handler(opts, { handler })) : dispatch(opts, handler)