diff --git a/packages/taro/src/interceptor/chain.js b/packages/taro/src/interceptor/chain.js index bbe41f088a3c..dc959849bfce 100644 --- a/packages/taro/src/interceptor/chain.js +++ b/packages/taro/src/interceptor/chain.js @@ -12,7 +12,7 @@ export default class Chain { } const nextInterceptor = this._getNextInterceptor() const nextChain = this._getNextChain() - return nextInterceptor(nextChain) + return nextInterceptor(nextChain).catch(err => Promise.reject(err)) } _getNextInterceptor () { diff --git a/packages/taro/src/interceptor/interceptors.js b/packages/taro/src/interceptor/interceptors.js index f487e943368c..bd9650fbf671 100644 --- a/packages/taro/src/interceptor/interceptors.js +++ b/packages/taro/src/interceptor/interceptors.js @@ -12,6 +12,10 @@ export function timeoutInterceptor (chain) { clearTimeout(timeout) resolve(res) }) + .catch(err => { + timeout && clearTimeout(timeout) + reject(err) + }) }) }