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

In geocoder, add support for error messages in json #21

Open
mraross opened this issue Sep 21, 2017 · 2 comments
Open

In geocoder, add support for error messages in json #21

mraross opened this issue Sep 21, 2017 · 2 comments
Labels
api enhancement New feature or request geocoder
Milestone

Comments

@mraross
Copy link

mraross commented Sep 21, 2017

Currently, all error responses are in html format.

Change error handling so that:

  1. A request for HTML or XHTML output returns an error in HTML format (as currently supported).
  2. A request for KML output returns an error in KML format (as currently supported).
  3. A request for json, geojson, CSV, or ShapeFile output returns an error in JSON format.

This is needed by JSON developers since JSON is the format they expect error objects to be in.

I propose we adopt the Google json error object as defined in:

https://google.github.io/styleguide/jsoncstyleguide.xml?showone=error#error
https://google.github.io/styleguide/jsoncstyleguide.xml?showone=error#error

So, for example, a request for a non-existent siteID and json output will return an HTTP Response code of 404 and the following JSON error object:

{
"apiVersion": "3.4",
"error": {
"code": 404,
"message": "Site Not Found",
}
}

@mraross mraross changed the title In geocoder, add support for a jsonErrors flag to get error messages in json instead of html In geocoder, add support for an errorsInJson flag to get error messages in json instead of html Sep 21, 2017
@mraross mraross changed the title In geocoder, add support for an errorsInJson flag to get error messages in json instead of html In geocoder, add support for an errorFormat flag to get error messages in json instead of html Sep 21, 2017
@mraross mraross changed the title In geocoder, add support for an errorFormat flag to get error messages in json instead of html In geocoder, add support for an errorFormat parameter to support error messages in json instead of html Sep 21, 2017
@mraross mraross changed the title In geocoder, add support for an errorFormat parameter to support error messages in json instead of html In geocoder, add support for error messages in json May 29, 2018
@mraross mraross transferred this issue from bcgov/api-specs Aug 31, 2019
@mraross mraross added this to the Geocoder 4.1 milestone Aug 31, 2019
@mraross mraross removed this from the Geocoder 4.1 milestone Sep 21, 2019
@mraross mraross added this to the Geocoder 4.1 milestone Feb 19, 2020
@mraross mraross removed this from the Geocoder 4.1 milestone Sep 14, 2020
@alixcote alixcote added this to the Geocoder 4.3 milestone Feb 25, 2023
@BK01 BK01 changed the title In geocoder, add support for error messages in json [?] In geocoder, add support for error messages in json Feb 27, 2023
@BK01 BK01 changed the title [?] In geocoder, add support for error messages in json In geocoder, add support for error messages in json Feb 27, 2023
@BK01
Copy link
Contributor

BK01 commented Feb 27, 2023

Return a 404 for hard errors. For 'site not found' errors, return a 200 (see #333).

@BK01
Copy link
Contributor

BK01 commented Dec 15, 2023

Validated in geocodertst (version 4.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request geocoder
Projects
None yet
Development

No branches or pull requests

4 participants