HttpClient: Handle HTTP status '502 Bad Gateway'.

This commit is contained in:
Andreas Schildbach 2018-12-18 11:05:42 +01:00
parent 4affd18885
commit 6e58ba6ebb

View file

@ -240,7 +240,8 @@ public final class HttpClient {
} else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM
|| responseCode == HttpURLConnection.HTTP_MOVED_TEMP) {
throw new UnexpectedRedirectException(url, HttpUrl.parse(response.header("Location")));
} else if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR) {
} else if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR
|| responseCode == HttpURLConnection.HTTP_BAD_GATEWAY) {
throw new InternalErrorException(url, bodyPeek);
} else {
final String message = "got response: " + responseCode + " " + response.message();