From 6e58ba6ebb113edc08cbf6730fb60189062dcaa4 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Tue, 18 Dec 2018 11:05:42 +0100 Subject: [PATCH] HttpClient: Handle HTTP status '502 Bad Gateway'. --- enabler/src/de/schildbach/pte/util/HttpClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enabler/src/de/schildbach/pte/util/HttpClient.java b/enabler/src/de/schildbach/pte/util/HttpClient.java index ad77b56e..74baa348 100644 --- a/enabler/src/de/schildbach/pte/util/HttpClient.java +++ b/enabler/src/de/schildbach/pte/util/HttpClient.java @@ -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();