ErrorReporterImpl

The ErrorReporter is a Singleton object in charge of collecting crash context data and sending crash reports. It registers itself as the Application's Thread default Thread.UncaughtExceptionHandler.

When a crash occurs, it collects data of the crash context (device, system, stack trace...) and writes a report file in the application private directory, which may then be sent.

Parameters

context

Context for the application in which ACRA is running.

config

AcraConfig to use when reporting and sending errors.

enabled

Whether this ErrorReporter should capture Exceptions and forward their reports.

supportedAndroidVersion

the minimal supported version

checkReportsOnApplicationStart

If reports should be checked on startup

Constructors

Link copied to clipboard
constructor(context: Application, config: CoreConfiguration, enabled: Boolean, supportedAndroidVersion: Boolean, checkReportsOnApplicationStart: Boolean)

Properties

Link copied to clipboard
open override val reportScheduler: SenderScheduler

Access point to manual report scheduling

Functions

Link copied to clipboard
open override fun clearCustomData()

Removes all key/value pairs from your reports custom data field.

Link copied to clipboard
open override fun getCustomData(key: String): String?

Gets the current value for a key in your reports custom data field.

Link copied to clipboard
open override fun handleException(e: Throwable?)

Send a normal report for the given exception.

open override fun handleException(e: Throwable?, endApplication: Boolean)

Send a normal report for the given exception

Link copied to clipboard
open override fun handleSilentException(e: Throwable?)

Send a silent report for the given exception

Link copied to clipboard
open override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?)
Link copied to clipboard
open override fun putCustomData(key: String, value: String): String?

Use this method to provide the ErrorReporter with data of your running application. You should call this at several key places in your code the same way as you would output important debug data in a log file. Only the latest value is kept for each key (no history of the values is sent in the report).

Link copied to clipboard
open override fun removeCustomData(key: String): String?

Removes a key/value pair from your reports custom data field.

Link copied to clipboard
open override fun setEnabled(enabled: Boolean)

Enable or disable this ErrorReporter. By default it is enabled.

Link copied to clipboard
open override fun uncaughtException(t: Thread, e: Throwable)
Link copied to clipboard