executeSafe method
- HttpRequest request
Execute request
and throw the response if it is not a HttpResponseSuccess
.
Implementation
Future<HttpResponseSuccess> executeSafe(HttpRequest request) async {
final response = await execute(request);
if (response is! HttpResponseSuccess) {
throw response;
}
return response;
}