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

Handle ProviderInvalidQueryError for every query() #1379

Merged

Conversation

totycro
Copy link
Contributor

@totycro totycro commented Oct 17, 2023

This is necessary for a more consistent error handling, where providers can raise ProviderInvalidQueryError for any query() call and the API will correspondingly return a code in the 4xx range with an error message.

Currently for some functions such as get_collection_items, a ProviderInvalidQueryError will only be handled as ProviderGenericError (its superclass), which leads to a 500 error code and no specific error message.

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution.
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

This is necessary for a more consistent error handling,
where providers can raise ProviderInvalidQueryError for any
`query()` call and the API will correspondingly return a code in the 4xx
range with an error message.
@tomkralidis tomkralidis merged commit e51cf65 into geopython:master Oct 18, 2023
2 checks passed
@totycro totycro deleted the consistent-query-error-handling branch October 18, 2023 10:55
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 this pull request may close these issues.

2 participants