SentryException.fromJson constructor

SentryException.fromJson(
  1. Map<String, dynamic> data
)

Deserializes a SentryException from JSON Map.

Implementation

factory SentryException.fromJson(Map<String, dynamic> data) {
  final json = AccessAwareMap(data);

  final stackTraceJson = json['stacktrace'];
  final mechanismJson = json['mechanism'];
  return SentryException(
    type: json['type'],
    value: json['value'],
    module: json['module'],
    stackTrace: stackTraceJson != null
        ? SentryStackTrace.fromJson(stackTraceJson)
        : null,
    mechanism:
        mechanismJson != null ? Mechanism.fromJson(mechanismJson) : null,
    threadId: json['thread_id'],
    unknown: json.notAccessed(),
  );
}