toResponse method

Map<String, dynamic> toResponse()

Converts the exception to a serializable response map (RFC 7807).

Implementation

Map<String, dynamic> toResponse() => {
      'type': type,
      'title': title,
      'status': statusCode,
      'detail': message,
      if (instance != null) 'instance': instance,
      if (details != null) 'extensions': details,
    };