unexpectedResponse method

  1. @override
Never unexpectedResponse(
  1. BaseResponse response,
  2. Uint8List body
)
override

Implementation

@override
Never unexpectedResponse(http.BaseResponse response, Uint8List body) {
  if (response.statusCode >= 400 && response.statusCode < 500) {
    final resp = json.decode(utf8.decode(body));
    if (resp is Map<String, Object?>) {
      throw MatrixException.fromJson(resp);
    }
  }
  super.unexpectedResponse(response, body);
}