rOpenGov / giscoR

Download geospatial data from GISCO API - Eurostat
https://ropengov.github.io/giscoR/
GNU General Public License v3.0
71 stars 1 forks source link

Better error message for temporary network / server problems #66

Closed pitkant closed 6 months ago

pitkant commented 1 year ago

GISCO services were unavailable earlier today. Running in v4-dev branch of eurostat package, I got the following message:

> sf <- get_eurostat_geospatial(
+ output_class = "sf",
+ year = 2006,
+  resolution = "60",
+  nuts_level = 0
+  )
Extracting data using giscoR package, please report issues on https://github.com/rOpenGov/giscoR/issues

url 
  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_60M_2006_4326_LEVL_0.geojson  not reachable.

Please download manually.  If you think this is a bug please consider opening an issue on  https://github.com/ropengov/giscoR/issues
Returning `NULL`

Of course it was probably different for users running on last CRAN release but I didn't test that. I just figured that we could be pre-emptive about such issues in the future and have a more descriptive message in case things go wrong because of server issues, in addition to "Please download manually" or "If you think this is a bug [...]", indicating the possibility of a problem being in the server.

The error message from disco-services.ec.europa.eu was 502 Bad gateway. Mozilla docs had a nice description of that (bold mine):

"A Gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through."

See also rOpenGov/eurostat#266

dieghernan commented 6 months ago

This would be solved on the upcoming release, see #80