Skip to content

Conversation

@rsd-raul
Copy link

I run into an issue with the invalid location detection when writting my response and short after with the solution here at 2.06.

The preference location-state never was changing to invalid location because the getInputStream() method throws a FileNotFoudException therefore not giving the method getWeatherDataFromJson the oportunity to retrieve the property cod containing the 404 we were looking for.

The solution is to use getErrorStream to parse the "error" server response and handle the 404 ourselves.

Ps: Also removed some warnings (null checks and similar).

I run into an issue with the invalid location detection when writting my response and short after with the solution here at 2.06.

The preference `location-state` never was changing to invalid location because the `getInputStream()` method throws a FileNotFoudException therefore not giving the method `getWeatherDataFromJson` the oportunity to retrieve the property `cod` containing the 404 we were looking for.

The solution is to use `getErrorStream` to parse the "error" server response and handle the 404 ourselves.

Ps: Also removed some warnings (null checks and similar).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant