refactor: remove error handle continue logic and make it throw error

its useful to help react query whether storage return data
pull/183/merge
moonrailgun 1 year ago
parent fb59827ca5
commit 16ed9da0cb

@ -72,11 +72,12 @@ function createRequest() {
}
}
// comment it logic because if not throw error, react query will cache `{ data: { result: false, msg: errorMsg, code } }` and has some problem
if (_isFunction(getErrorHook)) {
const isContinue = getErrorHook(err);
if (isContinue === false) {
return { data: { result: false, msg: errorMsg, code } };
}
// if (isContinue === false) {
// return { data: { result: false, msg: errorMsg, code } };
// }
}
throw new RequestError(errorMsg ?? err.message);

Loading…
Cancel
Save