MHException.fromJson constructor

MHException.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MHException.fromJson(Map<String, dynamic> json) {
  MHExceptionType type = MHExceptionTypeExtension.fromString(json['type']);

  return MHException(
    message: json['message'] ?? '',
    errors: (json['errors'] as List<dynamic>)
        .map((error) => ErrorDetail.fromJson(error))
        .toList(),
    type: type,
  );
}