Skip to content
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

Unexpected Error on all Forecast requests #61

Closed
Vortec4800 opened this issue Sep 19, 2019 · 3 comments · Fixed by #62
Closed

Unexpected Error on all Forecast requests #61

Vortec4800 opened this issue Sep 19, 2019 · 3 comments · Fixed by #62

Comments

@Vortec4800
Copy link
Contributor

This started yesterday. Has anyone else started seeing this? It seems like perhaps there was an API change or something? I'll keep investigating in the meantime.

@Vortec4800
Copy link
Contributor Author

Vortec4800 commented Sep 19, 2019

Okay, I was able to modify the SDK to spit out the actual decoding error and found the problem. Since yesterday, the nearby stations in Dallas have been unavailable. This changes the darksky-unavailable key in the JSON, and so it can't decode it. In the Struct, the decoder is expecting a Bool value for that key, but it's giving a string instead. Here is the JSON snippet for the flags key in my full API response for reference:

"flags": {
	"sources": ["nwspa", "cmc", "gfs", "hrrr", "icon", "isd", "madis", "nam", "sref", "darksky", "nearest-precip"],
	"nearest-station": 0.42,
	"units": "us",
	"darksky-unavailable": "Dark Sky covers the given location, but all stations are currently unavailable."
}

@Vortec4800
Copy link
Contributor Author

I tried running a request for a different location that has working radar stations, and that key is just missing if everything is okay, so I propose we just change the field to a String from a Bool. I'll send in a PR with this change for review.

@sxg
Copy link
Owner

sxg commented Sep 20, 2019

Thanks for catching the error and the pull request! It does appear as if that property would be better represented as a String?, so I've accepted the pull request. I'll put out the official update in just a minute.

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 a pull request may close this issue.

2 participants