Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ACRA with handled exceptions

I am using ACRA (Application Crash Report for Android) to send data when unhandled exceptions occur.

Methods like openFileOutput() requires me to try and catch iOExceptions. Since the exception is in a try catch block, ARCA is not triggered. However I would still like to receive and see the stacktrace. Are there any ways to achieve this?

like image 824
kevdliu Avatar asked Oct 18 '12 00:10

kevdliu


1 Answers

If handling the IOException, etc. doesn't really make sense (i.e., there is really nothing you can do about it), wrap it in a RuntimeException and throw it. ACRA will catch and report this. If you don't want to crash the app, catch and handle it, then use handleException() to send a report manually:

ACRA.getErrorReporter().handleException(caughtException);

More details here

like image 98
Nikolay Elenkov Avatar answered Oct 22 '22 18:10

Nikolay Elenkov