Pergunta

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.

Foi útil?

Solução

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} 
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top