From 59bb916d881aa8c8b3096fe3f1f52a762b2b024d Mon Sep 17 00:00:00 2001 From: laozhujia <841675486@qq.com> Date: Fri, 2 Mar 2018 14:21:43 +0800 Subject: [PATCH] interceptors return function with Promise.reject the reject add to every response handler. when interceptor next function params return a Promise.reject() the first response handler will catch it and run reject. if the reject not throw new error the next response handlers will still run resolve function with the reject return value --- src/http/client/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/client/index.js b/src/http/client/index.js index 56cd5993..07ed7d54 100644 --- a/src/http/client/index.js +++ b/src/http/client/index.js @@ -32,7 +32,7 @@ export default function (context) { resHandlers.forEach(handler => { response = when(response, response => { return handler.call(context, response) || response; - }, reject); + }); }); when(response, resolve, reject);