diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java index 7ad0154eea..150401b0da 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/HttpClient.java @@ -537,6 +537,14 @@ public class HttpClient { Debug.logWarning(ioe.getCause(), module); return sendHttpRequestStream(method, true); } + if ((con instanceof HttpURLConnection)) { + try { + in = ((HttpURLConnection) con).getErrorStream(); + } catch (Exception ioerror) { + throw new HttpClientException("IO Error processing request", ioerror); + } + return in; + } throw new HttpClientException("IO Error processing request", ioe); } catch (RuntimeException e) { throw e;