toJson method

Map<String, dynamic> toJson()

Converts this Err to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  final model = toModel();
  return {
    if (model.type != null) 'type': model.type,
    if (model.error != null) 'error': model.error,
    if (model.statusCode != null) 'statusCode': model.statusCode,
    if (model.stackTrace != null) 'stackTrace': model.stackTrace,
  };
}