Question

Is it possible to send custom data with acra without actually having a Throwable?

I´ve seen that it is possible to append custom crashdata by using

ACRA.getErrorReporter().putCustomData()

But the data will only be send if there will follow an exception.

The intention of doing it is an app I´m working on, which uses webview and I want to send Javascript errors as well as native ones.

Était-ce utile?

La solution

I just found the way, you just need to give null as parameter instead of an Exception, for example:

ACRA.getErrorReporter().putCustomData("myKey", "myValue");
ACRA.getErrorReporter().handleException(null);

These 2 lines will report this error:

java.lang.Exception: Report requested by developer

With the following as custom data in the report:

{myKey:myValue} 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top