Event

open class Event : JsonStream.Streamable, MetadataAware, UserAware

An Event object represents a Throwable captured by Bugsnag and is available as a parameter on an OnErrorCallback, where individual properties can be mutated before an error report is sent to Bugsnag's API.

Functions

addMetadata
Link copied to clipboard
open fun addMetadata(@NonNull() section: String, @NonNull() value: Map<String, out Any>)
Adds a map of multiple metadata key-value pairs to the specified section.
abstract fun addMetadata(section: Null, value: Null)
open fun addMetadata(@NonNull() section: String, @NonNull() key: String, @Nullable() value: Any)
Adds the specified key and value in the specified section.
clearMetadata
Link copied to clipboard
open fun clearMetadata(@NonNull() section: String)
Removes all the data from the specified section.
abstract fun clearMetadata(section: Null)
open fun clearMetadata(@NonNull() section: String, @NonNull() key: String)
Removes data with the specified key from the specified section.
getApiKey
Link copied to clipboard
open fun getApiKey(): String
The API key used for events sent to Bugsnag.
getApp
Link copied to clipboard
open fun getApp(): AppWithState
Information set by the notifier about your app can be found in this field.
getBreadcrumbs
Link copied to clipboard
open fun getBreadcrumbs(): List<Breadcrumb>
A list of breadcrumbs leading up to the event.
getContext
Link copied to clipboard
open fun getContext(): String
Returns the context of the error.
getDevice
Link copied to clipboard
open fun getDevice(): DeviceWithState
Information set by the notifier about your device can be found in this field.
getErrors
Link copied to clipboard
open fun getErrors(): List<Error>
Information extracted from the Throwable that caused the event can be found in this field.
getGroupingHash
Link copied to clipboard
open fun getGroupingHash(): String
Set the grouping hash of the event to override the default grouping on the dashboard.
getMetadata
Link copied to clipboard
open fun getMetadata(@NonNull() section: String): Map<String, Any>
Returns a map of data in the specified section.
abstract fun getMetadata(section: Null): Null
open fun getMetadata(@NonNull() section: String, @NonNull() key: String): Any
Returns the value of the specified key in the specified section.
getOriginalError
Link copied to clipboard
open fun getOriginalError(): Throwable
The Throwable object that caused the event in your application.
getSeverity
Link copied to clipboard
open fun getSeverity(): Severity
The severity of the event.
getThreads
Link copied to clipboard
open fun getThreads(): List<Thread>
If thread state is being captured along with the event, this field will contain a list of Thread objects.
getUser
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
isUnhandled
Link copied to clipboard
open fun isUnhandled(): Boolean
Whether the event was a crash (i.e.
setApiKey
Link copied to clipboard
open fun setApiKey(@NonNull() apiKey: String)
The API key used for events sent to Bugsnag.
setContext
Link copied to clipboard
open fun setContext(@Nullable() context: String)
Sets the context of the error.
setGroupingHash
Link copied to clipboard
open fun setGroupingHash(@Nullable() groupingHash: String)
Set the grouping hash of the event to override the default grouping on the dashboard.
setSeverity
Link copied to clipboard
open fun setSeverity(@NonNull() severity: Severity)
The severity of the event.
setUnhandled
Link copied to clipboard
open fun setUnhandled(unhandled: Boolean)
Whether the event was a crash (i.e.
setUser
Link copied to clipboard
open fun setUser(@Nullable() id: String, @Nullable() email: String, @Nullable() name: String)
Sets the user associated with the event.
abstract fun setUser(id: Null, email: Null, name: Null)
toStream
Link copied to clipboard
open fun toStream(@NonNull() stream: JsonStream)