Event

open class Event : JsonStream.Streamable, MetadataAware, UserAware, FeatureFlagAware

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

Link copied to clipboard
open fun addFeatureFlag(@NonNull name: String)
Add a single feature flag with no variant.
open fun addFeatureFlag(@NonNull name: String, @Nullable variant: String)
Add a single feature flag with an optional variant.
Link copied to clipboard
open fun addFeatureFlags(@NonNull featureFlags: Iterable<FeatureFlag>)
Add a collection of feature flags.
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.
open fun addMetadata(@NonNull section: String, @NonNull key: String, @Nullable value: Any)
Adds the specified key and value in the specified section.
Link copied to clipboard
open fun clearFeatureFlag(@NonNull name: String)
Remove a single feature flag regardless of its current status.
Link copied to clipboard
Clear all of the feature flags.
Link copied to clipboard
open fun clearMetadata(@NonNull section: String)
Removes all the data from the specified section.
open fun clearMetadata(@NonNull section: String, @NonNull key: String)
Removes data with the specified key from the specified section.
Link copied to clipboard
The API key used for events sent to Bugsnag.
Link copied to clipboard
Information set by the notifier about your app can be found in this field.
Link copied to clipboard
A list of breadcrumbs leading up to the event.
Link copied to clipboard
Returns the context of the error.
Link copied to clipboard
Information set by the notifier about your device can be found in this field.
Link copied to clipboard
Information extracted from the Throwable that caused the event can be found in this field.
Link copied to clipboard
A list of feature flags active at the time of the event.
Link copied to clipboard
Set the grouping hash of the event to override the default grouping on the dashboard.
Link copied to clipboard
open fun getMetadata(@NonNull section: String): Map<String, Any>
Returns a map of data in the specified section.
open fun getMetadata(@NonNull section: String, @NonNull key: String): Any
Returns the value of the specified key in the specified section.
Link copied to clipboard
The Throwable object that caused the event in your application.
Link copied to clipboard
The severity of the event.
Link copied to clipboard
If thread state is being captured along with the event, this field will contain a list of Thread objects.
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
Link copied to clipboard
open fun isUnhandled(): Boolean
Whether the event was a crash (i.e.
Link copied to clipboard
open fun setApiKey(@NonNull apiKey: String)
The API key used for events sent to Bugsnag.
Link copied to clipboard
open fun setContext(@Nullable context: String)
Sets the context of the error.
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.
Link copied to clipboard
open fun setSeverity(@NonNull severity: Severity)
The severity of the event.
Link copied to clipboard
open fun setUnhandled(unhandled: Boolean)
Whether the event was a crash (i.e.
Link copied to clipboard
open fun setUser(@Nullable id: String, @Nullable email: String, @Nullable name: String)
Sets the user associated with the event.
Link copied to clipboard
open fun toStream(@NonNull stream: JsonStream)