BugsnagEvent class

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

Constructors

BugsnagEvent.fromJson(Map<String, dynamic> json)

Properties

apiKey String?
getter/setter pair
app BugsnagAppWithState
Information set by the notifier about your app can be found in this field. These values can be accessed and amended if necessary.
getter/setter pair
A list of breadcrumbs leading up to the event. These values can be accessed and amended if necessary.
getter/setter pair
context String?
The context of the error. The context is a summary of what was occurring in the application at the time of the crash, if available, such as the visible page or screen.
getter/setter pair
device BugsnagDeviceWithState
Information set by the notifier about your device can be found in this field. These values can be accessed and amended if necessary.
getter/setter pair
errors List<BugsnagError>
Information extracted from the errors that caused the event can be found in this field. The list contains at least one BugsnagError that represents the thrown object.
getter/setter pair
groupingHash String?
The grouping hash of the event to override the default grouping on the dashboard. All events with the same grouping hash will be grouped together into one error. This is an advanced usage of the library and mis-using it will cause your events not to group properly in your dashboard.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
severity BugsnagSeverity
The severity of the event. By default, unhandled exceptions will be BugsnagSeverity.error and handled exceptions sent with Client.notify BugsnagSeverity.warning.
getter/setter pair
threads List<BugsnagThread>
If thread state is being captured along with the event, this field will contain a list of BugsnagThread objects representing the native threads that were active when the error was captured.
getter/setter pair
unhandled bool
Whether the event was a crash (i.e. unhandled) or handled error in which the system continued running.
getter/setter pair
user BugsnagUser
The User information associated with this event
no setter

Methods

addFeatureFlag(String name, [String? variant]) → void
Add a single feature flag with an optional variant. If there is an existing feature flag with the same name, it will be overwritten with the new variant.
addMetadata(String section, Map<String, Object> metadata) → void
Adds a map of multiple metadata key-value pairs to the specified section.
clearFeatureFlag(String name) → void
Remove a single feature flag regardless of its current status. This will stop the specified feature flag from being reported. If the named feature flag does not exist this will have no effect.
clearFeatureFlags() → void
Clear all of the feature flags. This will stop all feature flags from being reported.
clearMetadata(String section, [String? key]) → void
If key is not null: removes data with the specified key from the specified section. Otherwise remove all the data from the specified section.
getMetadata(String section) Map<String, Object>?
Returns a map of data in the specified section.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setUser({String? id, String? email, String? name}) → void
Sets the user associated with the event.
toJson() → dynamic
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited