unexpectedResponse method

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

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 SDNException.fromJson(resp);
    }
  }
  super.unexpectedResponse(response, body);
}