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

Constructors

Mechanism({required String type, String? description, String? helpLink, bool? handled, bool? synthetic, Map<String, dynamic>? meta, Map<String, dynamic>? data, bool? isExceptionGroup, String? source, int? exceptionId, int? parentId})
Mechanism.fromJson(Map<String, dynamic> json)
Deserializes a Mechanism from JSON Map.
factory

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
exceptionId int?
An optional numeric value providing an ID for the exception relative to this specific event.
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
isExceptionGroup bool?
An optional boolean value, set true when the exception is the exception group type specific to the platform or language. The default is false when omitted. For example, exceptions of type PlatformException have set it to true, others are set to false.
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
parentId int?
An optional numeric value pointing at the exceptionId that is the parent of this exception.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String?
An optional string value describing the source of the exception.
final
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, bool? isExceptionGroup, String? source, int? exceptionId, int? parentId}) Mechanism
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Produces a Map that can be serialized to JSON.
toString() String
A string representation of this object.
inherited

Operators

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