How create detailed stack traces in Google Analytics v4 crash reports for uncaught exceptions?

大兔子大兔子 提交于 2019-12-23 19:38:45

问题


By default Google Analytics reports only the top line of an uncaught exception in its crash reports (see first picture in this blog post).

I have problems having Google Analytics to show stack traces of uncaught exceptions in my app that reflect the whole stack, rather than the first line (see second picture in the blog post mentioned above for the intended result).

The problem as well as a solution are explained on this blog post mentioned above. However, the solution relates to v2 of the Google Analytics library and not to the current v4 (the EasyTracker class is obsolete).

As the Google Analytics documentation states the correct approach should be to create a custom ExceptionParser and use this for formatting the exception message before sending to Google. My problem is that this example in documentation relates to a caught exceptions handled in a try-catch block in the code. I would like to do the same for all uncaught exceptions, the ones that I do not handle in a try-catch block.

Any pointers in the right direction would be appreciated greatly.

来源:https://stackoverflow.com/questions/24001136/how-create-detailed-stack-traces-in-google-analytics-v4-crash-reports-for-uncaug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!