Skip to content

Return structured JSON error messages with 400 status code #32

@jwalgran

Description

@jwalgran

Currently the service either returns a 500 status code when 400 is more appropriate.

Currently, the error returned is a plain string, which forces client code to resort to string matching in order to take different actions based on the specific failure.

Errors should, be structured and include a switch-able code and a detailed message to help developers in debugging.

{
  "error": "no_data_for_region",
  "message": "Species data not found for the NoWestYYY region"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions