Mechanism class

Sentry Exception Mechanism The exception mechanism is an optional field residing in the Exception Interface. It carries additional information about the way the exception was created on the target system. This includes general exception values obtained from operating system or runtime APIs, as well as mechanism-specific values.

Annotations
  • @immutable

Constructors

Mechanism({required String type, String? description, String? helpLink, bool? handled, bool? synthetic, Map<String, dynamic>? meta, Map<String, dynamic>? data})

Properties

data Map<String, dynamic>
Arbitrary extra data that might help the user understand the error thrown by this mechanism
no setter
description String?
Optional human readable description of the error mechanism and a possible hint on how to solve this error
final
handled bool?
Optional flag indicating whether the exception has been handled by the user (e.g. via try..catch)
final
hashCode int
The hash code for this object.
no setterinherited
Optional fully qualified URL to an online help resource, possible interpolated with error parameters
final
meta Map<String, dynamic>
Optional information from the operating system or runtime on the exception mechanism The mechanism meta data usually carries error codes reported by the runtime or operating system, along with a platform dependent interpretation of these codes. SDKs can safely omit code names and descriptions for well known error codes, as it will be filled out by Sentry. For proprietary or vendor-specific error codes, adding these values will give additional information to the user.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
synthetic bool?
An optional flag indicating that this error is synthetic. Synthetic errors are errors that carry little meaning by themselves. This may be because they are created at a central place (like a crash handler), and are all called the same: Error, Segfault etc. When the flag is set, Sentry will then try to use other information (top in-app frame function) rather than exception type and value in the UI for the primary event display. This flag should be set for all "segfaults" for instance as every single error group would look very similar otherwise.
final
type String
Required unique identifier of this mechanism determining rendering and processing of the mechanism data The type attribute is required to send any exception mechanism attribute, even if the SDK cannot determine the specific mechanism. In this case, set the type to "generic". See below for an example.
final

Methods

copyWith({String? type, String? description, String? helpLink, bool? handled, Map<String, dynamic>? meta, Map<String, dynamic>? data, bool? synthetic}) Mechanism
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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