添加额外的信息,未捕获的异常 [英] Add extra information to uncaught exception
问题描述
在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屋!