mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-10-14 19:22:13 +08:00
fix: 处理 default 异常问题?
This commit is contained in:
parent
bae7c46200
commit
65ff06cf4a
@ -168,8 +168,11 @@ function handleRequestError({
|
||||
const errorKey = getErrorKey(error, response);
|
||||
|
||||
if (!isSkipErrorHandler(config, errorKey)) {
|
||||
const errorHandlerFn = errorHandler[errorKey || 'default'];
|
||||
errorHandlerFn && errorHandlerFn(error, response);
|
||||
if (isFunction(errorHandler[errorKey])) {
|
||||
errorHandler[errorKey](error, response);
|
||||
} else if (isFunction(errorHandler.default)) {
|
||||
errorHandler.default(error, response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ export default {
|
||||
|
||||
const get = () => {
|
||||
request('/api', null, {
|
||||
skipErrorHandler: '123'
|
||||
skipErrorHandler: ['500']
|
||||
}).catch((err) => {
|
||||
console.log('skip error', err);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user