添加额外的信息,未捕获的异常 [英] Add extra information to uncaught exception

查看:125
本文介绍了添加额外的信息,未捕获的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google.Play有一个关于未捕获的异常统计。我想知道有没有办法添加一些额外的信息异常,因此它将在Google.Play显示(导致无法使用第三方错误报告服务)。

In Google.Play there is a statistic about uncaught exceptions. I would like to know is there any way to add some extra information to exception, so it will be shown in Google.Play (cause third party error reporting services can't be used).

我知道 Thread.setUncaughtExceptionHandler ,我想我可以写类似

I know about Thread.setUncaughtExceptionHandler and I suppose I can write something like

public void uncaughtException (Thread thread, Throwable ex) {
    throw new CustomException(ex, "extraData");
}

例如与我自定义异常消息。

with my custom exception message for example.

但是否有任何其他方式来实现这一目标?

But are there any other ways to achieve this?

推荐答案

您可以使用 ACRA 。除了比谷歌提供更多的信息播放崩溃报告,它也可以让你轻松地添加<一个href=\"https://github.com/ACRA/acra/wiki/AdvancedUsage#wiki-Adding_your_own_variables_content_or_traces_in_crash_reports\"相对=nofollow>自定义数据汇报。

You could use ACRA. In addition to providing a lot more information than the Google Play crash reports, it also allows you to easily add custom data to the reports.

这篇关于添加额外的信息,未捕获的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆