responseToNullableValue<Value> function
- Response<
Value> response
Maps chopper responses to their corresponding values (if successful). Throws if the response is an error.
Implementation
Value responseToNullableValue<Value>(Response<Value> response) {
if (response.isSuccessful) {
return response.body as Value;
} else {
throw response.error as Object;
}
}