【问题标题】:Wait until Sentry sent the error report before exiting the application等到 Sentry 发送错误报告后再退出应用程序
【发布时间】:2018-04-25 11:02:22
【问题描述】:

我正在使用 Sentry 从我的桌面应用程序报告错误。我遇到的一个问题是,如果异常导致应用程序崩溃,它似乎永远不会到达 Sentry 服务器。从调试 Sentry 本身来看,似乎异常被放置在缓冲区中以供稍后发送,但在这种特殊情况下,我需要同步发送它们。

我该怎么做?

我正在报告这样的异常:

Sentry.capture(e);

【问题讨论】:

    标签: java sentry


    【解决方案1】:

    Sentry 公开了一个方法 close which internally calls the closeConnection

    看着BufferedConnection, the code will wait for sometime to let the buffer clear

    简而言之:尝试拨打:Sentry.close();

    【讨论】:

    • 谢谢。我以为close() 会立即关闭,但我并没有仔细研究它。
    猜你喜欢
    • 2021-02-17
    • 2018-08-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多