rOpenGov / eurostat

R tools for Eurostat data
http://ropengov.github.io/eurostat
Other
234 stars 46 forks source link

Return informative get_eurostat_json error messages to the user #261

Closed pitkant closed 1 year ago

pitkant commented 1 year ago

Eurostat website lists different types of HTTP status errors that Statistics API can return. As mentioned in #260 these error messages are not returned to the end user in R but they can be viewed e.g. in the web browser. It would be good if these ids (fault codes) and labels (descriptions) would be returned to the user in R as well.

Fault code HTTP status Description
Client Errors
100 No results found 400 Bad request The result from the query is empty.
100 No results found 404 Not Found The requested resource is not available.
140 Syntax error 400 Bad request The query is invalid.
150 Semantic error 400 Bad request The request is syntactically correct but fails a semantic validation, business rules.
Server errors    
500 Internal Server error 500 Internal server error The webservice should return this error code when none of the other error codes better describes the reason for the failure of the service to provide a meaningful response.Also used in case of request not respecting the xsd definition.
pitkant commented 1 year ago

Solved in #262 and d74bcb7