mirror of
https://github.com/craigerl/aprsd.git
synced 2024-09-28 08:06:37 -04:00
Fixed an issue with LocationPlugin
When calling LocationPlugin with a callsign outside of the US, the forecast.weather gov wasn't raising an exception. A valid json dict was coming back, but it didn't have location data we were expecting.
This commit is contained in:
parent
51894bbab8
commit
0d18e54969
@ -65,6 +65,10 @@ class LocationPlugin(plugin.APRSDPluginBase):
|
|||||||
LOG.error("Couldn't fetch forecast.weather.gov '{}'".format(ex))
|
LOG.error("Couldn't fetch forecast.weather.gov '{}'".format(ex))
|
||||||
wx_data = {"location": {"areaDescription": "Unknown Location"}}
|
wx_data = {"location": {"areaDescription": "Unknown Location"}}
|
||||||
|
|
||||||
|
if "location" not in wx_data:
|
||||||
|
LOG.error("Couldn't fetch forecast.weather.gov '{}'".format(wx_data))
|
||||||
|
wx_data = {"location": {"areaDescription": "Unknown Location"}}
|
||||||
|
|
||||||
reply = "{}: {} {}' {},{} {}h ago".format(
|
reply = "{}: {} {}' {},{} {}h ago".format(
|
||||||
searchcall,
|
searchcall,
|
||||||
wx_data["location"]["areaDescription"],
|
wx_data["location"]["areaDescription"],
|
||||||
|
Loading…
Reference in New Issue
Block a user