toEncodingResponse<T> method
Implementation
@override
T toEncodingResponse<T>(
ServiceReponseEncoding encoding, {
CbEncodingErr<T>? onErr,
}) {
try {
if (encoding == this.encoding) {
return JsonParser.valueAs<T>(response);
}
final encode = ServiceProviderUtils.ecodeResponse(
body: response,
encoding: encoding,
);
return JsonParser.valueAs<T>(encode);
} catch (_) {
if (onErr != null) {
final response = onErr(this.response, encoding);
if (response != null) return response;
}
rethrow;
}
}