如何解决如何禁用显示'Unhandled RejectionError:XXXXX'的react dev error面板?
Unhandled Rejection (Error): User does not exist
(anonymous function)
src/service/index.ts:102
99 | if (customConfig.rawData) return res.data
100 | if (res.data.code != 0) {
101 | const message = res.data.msg || `Api Error:code - ${res.data.code}`
> 102 | const error = new Error(message)
| ^ 103 | ;(error as any).response = res
104 | ;(error as any).config = res.config
105 | ;(error as any).response = res
View compiled
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.
当我收到api错误时抛出错误,并在窗口上通过事件'unhandledrejection'捕获该错误。但是在React应用程序中,有一个开发错误提示面板,如图所示。我该如何禁用它,我不需要它。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。