handleHttpError function

void handleHttpError(
  1. Response response
)

Implementation

void handleHttpError(http.Response response) {
  if (response.statusCode != 200) {
    throw Exception(
        "Failed HTTP request with status code: ${response.statusCode}");
  }
}