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

Non-existing country code should give clearer error #56

Closed
felixcremer opened this issue Jun 1, 2023 · 1 comment · Fixed by #69
Closed

Non-existing country code should give clearer error #56

felixcremer opened this issue Jun 1, 2023 · 1 comment · Fixed by #69
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@felixcremer
Copy link
Member

When I use a wrong country code in the get function I get a cryptic 404 HTTP error and I think it would be helpful to give a more descriptive error, so that users know what they made wrong.

GADM.get("GER")

HTTP.Exceptions.StatusError(404, "GET", "/gadm/gadm4.1/gpkg/gadm41_GER.gpkg", HTTP.Messages.Response:
"""
HTTP/1.1 404 Not Found
Date: Thu, 01 Jun 2023 07:29:33 GMT
Server: Apache/2.4.52 (Ubuntu)
Content-Length: 282
Content-Type: text/html; charset=iso-8859-1

""")

Instead of this error I would have hoped for an error stating.
ArgumentError: Country code "GER" not found, please provide standard ISO 3 country codes.

@juliohm juliohm added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 1, 2023
@juliohm
Copy link
Member

juliohm commented Jun 1, 2023

Thank you for reporting the issue @felixcremer. Feel free to submit a PR if you have the time, otherwise we will try to address the issue by next month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants