Skip to content

2.06 - Fixed problem with Json parsing. #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.06_Detect_Invalid_Location
Choose a base branch
from

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