ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Malorny <>
Subject Re: How to capture HTTP response with the status 500?
Date Tue, 17 Jan 2017 08:17:04 GMT
On 17.01.17 08:08, Al Le wrote:
>> So maybe it's because of the inbuilt JDK's implementation of
>> connection.getInputStream (it throws an exception if the status is 500).
> I've debugged it and found out that
> the connection object is of type ''
> which delegates the getInputStream() method to ''
> which throws an exception if the status is greater than or equal to 400.
> This makes me think that it will not be possible to get the full response without a custom
implementation of URLConnection.
> AL

Hi AL,

I don't think you'll need to have a custom implementation. I cannot remember 
whether I have ever used it, but I am quite confident that you can call the 
Method HttpURLConnection.getErrorStream within the respective catch block to 
read the body of the HTTP response. Hope that helps.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message