Closed sussertod891015 closed 4 years ago
我是这样处理的,没用umi的request 在app文件中rootContainer中配置ahooks的错误拦截,页面级别如果没有catch和配置onError会走全局的,页面级别有的话 会走页面级别的 可以参考下 https://github.com/wetrial/wetrial-template/blob/master/src/app.tsx
+1 拿不到error 都是undefined
const { data, loading, error } = useRequest(() => {
return getFilters();
});
为什么收到的data是undefined。
使用useRequest请求接口,抛出了异常,但是捕获不到
最小可复现仓库
devScripts.js:5836 BizError: 产品Id不能为空 at _callee$ (http://localhost:8002/umi.js:160735:23) at tryCatch (http://localhost:8002/umi.js:58549:40) at Generator.invoke [as _invoke] (http://localhost:8002/umi.js:58778:22) at Generator.prototype. [as next] (http://localhost:8002/umi.js:58601:21)
at asyncGeneratorStep (http://localhost:8002/umi.js:56037:24)
at _next (http://localhost:8002/umi.js:56059:9)
我想问下该如何捕获这个异常
相关环境信息