forecastio-lib-java icon indicating copy to clipboard operation
forecastio-lib-java copied to clipboard

System.err Bad Response: </html>

Open dhakimTRX opened this issue 7 years ago • 2 comments

I'm using version 1.6.0 of ForecastIOLib, linked as Dependencies{ implementation 'com.github.dvdme:ForecastIOLib:1.6.0' }

I'm seeing error messages in my Android logs but I can't debug them further using what ForecastIO is logging.

I see: 05-07 18:05:47.151 6447 6780 W System.err: Bad Response:

I believe this is printed at ForecastIO.java:781, System.err.println("Bad Response: " + response + "\n");

It seems that the library is only printing the last line of the error stream, and that error stream seems to be an HTML page.

If you could return a response code or the response stream to the application, it could decide whether or not to retry or let the end user address the issue in some way.

dhakimTRX avatar May 21 '18 15:05 dhakimTRX

As an aside, I suspect the underlying failure was due to either invalid construction of latitude/longitude due to localization or inclusion of spaces in the exclude url in some app installs.

dhakimTRX avatar May 21 '18 15:05 dhakimTRX

Appears the html response is from an nginx Bad Gateway that triggers if spaces in the exclude url are not url encoded.

502 Bad Gateway

502 Bad Gateway


nginx

dhakimTRX avatar May 21 '18 16:05 dhakimTRX