diff --git a/index.js b/index.js index f13bbc5..7dc8825 100644 --- a/index.js +++ b/index.js @@ -147,10 +147,10 @@ module.exports = { .catch((error) => { // {errMsg, stack} = error if (/request:fail/.test(error.errMsg)) { // 后台云服务无法连接 - return { result: { _state: 'CLIENT_BACKEND_BROKEN' } } - } else { + result = { _state: 'CLIENT_BACKEND_BROKEN', error } + } else { // 后台云服务返回异常 - return { result: { _state: 'CLIENT_BACKEND_EXCEPTION', error } } + result = { _state: 'CLIENT_BACKEND_EXCEPTION', error } } }) result = resultCloud @@ -170,10 +170,10 @@ module.exports = { if (error) { if (error.errMsg === 'request:fail') { // 后台服务器无法连接 - result = { _state: 'CLIENT_BACKEND_BROKEN' } + result = { _state: 'CLIENT_BACKEND_BROKEN', error } } else if (error.errMsg === 'request:fail timeout') { // 后台服务器超时 - result = { _state: 'CLIENT_BACKEND_TIMEOUT' } + result = { _state: 'CLIENT_BACKEND_TIMEOUT', error } } else { // 后台服务器返回异常 result = { _state: 'CLIENT_BACKEND_EXCEPTION', error }