ErrorReporterImpl

class ErrorReporterImpl(context: Application, config: CoreConfiguration, enabled: Boolean, supportedAndroidVersion: Boolean, checkReportsOnApplicationStart: Boolean) : Thread.UncaughtExceptionHandler, SharedPreferences.OnSharedPreferenceChangeListener, ErrorReporter

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

ErrorReporterImpl
Link copied to clipboard
fun ErrorReporterImpl(context: Application, config: CoreConfiguration, enabled: Boolean, supportedAndroidVersion: Boolean, checkReportsOnApplicationStart: Boolean)
Context for the application in which ACRA is running.

Functions

clearCustomData
Link copied to clipboard
open override fun clearCustomData()
Removes all key/value pairs from your reports custom data field.
getCustomData
Link copied to clipboard
open override fun getCustomData(key: String): String?
Gets the current value for a key in your reports custom data field.
handleException
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
handleSilentException
Link copied to clipboard
open override fun handleSilentException(e: Throwable?)
Send a silent report for the given exception
onSharedPreferenceChanged
Link copied to clipboard
open override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?)
putCustomData
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.
removeCustomData
Link copied to clipboard
open override fun removeCustomData(key: String): String?
Removes a key/value pair from your reports custom data field.
setEnabled
Link copied to clipboard
open override fun setEnabled(enabled: Boolean)
Enable or disable this ErrorReporter.
uncaughtException
Link copied to clipboard
open override fun uncaughtException(t: Thread, e: Throwable)
unregister
Link copied to clipboard
fun unregister()

Properties

reportScheduler
Link copied to clipboard
open override val reportScheduler: SenderScheduler
Access point to manual report scheduling