unexpectedResponse method

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

Implementation

@override
Never unexpectedResponse(http.BaseResponse response, Uint8List body) {
  MatrixException? matrixException;
  try {
    matrixException =
        MatrixException.fromJson(json.decode(utf8.decode(body)));
  } catch (_) {} // Is not a MatrixException!
  if (matrixException != null && matrixException.raw.containsKey('errcode')) {
    throw matrixException;
  }

  super.unexpectedResponse(response, body);
}