HttpResponseException.fromResponse constructor

HttpResponseException.fromResponse(
  1. Response response, {
  2. String? errorMessage,
})

Implementation

factory HttpResponseException.fromResponse(
  http.Response response, {
  String? errorMessage,
}) {
  return HttpResponseException._(
    response.body,
    response.statusCode,
    headers: response.headers,
    isRedirect: response.isRedirect,
    persistentConnection: response.persistentConnection,
    reasonPhrase: response.reasonPhrase,
    request: response.request,
    errorMessage: errorMessage,
  );
}