我有这个
bugsnagClient.use(bugsnagReact, React)
const ErrorBoundary = bugsnagClient.getPlugin('react')
<ErrorBoundary FallbackComponent={ErrorFallbackComponent}>
<AppContainer />
</ErrorBoundary>
export const ErrorFallbackComponent = () => <div>An error has occurred</div>然而,我只注意到错误,我实际上做了bugsnagClient.notify(new Error(error.errorMessage));
我想知道我是否必须将bugsnagClient.notify(new Error(error.errorMessage));添加到我的错误边界中,如果是的话,如何添加?
我正在研究this,但我不确定bugsnag代码是否已经包装了我的代码,并且已经有了这些方法。
发布于 2019-07-04 15:53:35
我建议看看Bugsnag示例React应用程序,看看应该如何使用ErrorBoundary:
https://github.com/bugsnag/bugsnag-js/tree/master/examples/react
https://github.com/bugsnag/bugsnag-js/blob/master/examples/react/src/index.js
如果你仍然有问题,请联系Bugsnag支持,我们会看一看。
谢谢!
https://stackoverflow.com/questions/56819295
复制相似问题