【问题标题】:React Native - Sentry.captureException not workingReact Native - Sentry.captureException 不起作用
【发布时间】:2021-03-08 21:34:15
【问题描述】:

我正在尝试在我的 React Native 应用程序中使用 Sentry.captureException,但它无法正常工作。 我收到了 eventId,但 Sentry 网站上没有问题。

代码如下:

const eventId = Sentry.captureException(new Error("Testing"));
console.log(eventId); /// ccfa8f3799524c8ea9e138fb792******

PS。本机错误可以正常工作,如果我尝试 throw('Testing') 它可以工作。

PS。 仅限 Android,iOS 运行良好

  • RN:0.63.3
  • @sentry/react-native:2.0.0

【问题讨论】:

    标签: react-native sentry


    【解决方案1】:

    你可以这样使用它:

    Sentry.captureEvent({
        event_id: <error_id>,
        message: <message>,
        extra: <data_in_json>,
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-19
      • 2018-06-20
      • 2017-12-29
      • 2017-10-14
      • 2021-11-05
      • 2016-08-12
      • 1970-01-01
      相关资源
      最近更新 更多