ACRA/acra — pull request #87 by yuriykulikov (2013-05-07 21:04:43+00:00)
Title: Added a new method ErrorReporter#addOnExceptionHandledCommand

Sometimes it could be nice to put custom data also to the uncaught exception. Of course, we can add an uncaught exception handler to all threads after initalizing ACRA, but this might not be very straightforward.

Use this method to add commands to be executed before the ErrorReporter
handles the throwable. This can be used to put custom data.

This allows to add custom data to uncaught exceptions and to be sure that all silent exceptions contain the same data set.

Example usage (in onCreate, after initing ACRA)

ACRA.getErrorReporter().addOnExceptionHandledCommand(new Runnable() {
@Override
public void run() {
ACRA.getErrorReporter().putCustomData("STARTUP_LOG",
StartupLogWriter.getInstance().getMessagesAsString());
}
});

I hope this can be useful.