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

Account for different error response formats #37

Open
aoles opened this issue Jun 12, 2018 · 1 comment
Open

Account for different error response formats #37

aoles opened this issue Jun 12, 2018 · 1 comment
Assignees
Labels
🪲 bug Something isn't working
Milestone

Comments

@aoles
Copy link
Member

aoles commented Jun 12, 2018

API error responses might have different formats, such as:

{
  "error": "Key not authorised"
}
{
  "error": {
    "code": 2001,
    "message": "Parameter 'profile' is missing."
  },
  "info": {
    "engine": {
      "version": "4.5.0",
      "build_date": "2018-03-26T13:41:46Z"
    },
    "timestamp": 1528811534758
  }
}
{
    "code": 4000,
    "message": "Invalid JSON object in request"
}

Add test for this!

@aoles aoles added the 🪲 bug Something isn't working label Jun 12, 2018
@aoles aoles added this to the version 0.2.0 milestone Jun 12, 2018
@aoles aoles self-assigned this Jun 12, 2018
@aoles aoles added this to To do in version 0.2.0 via automation Jun 12, 2018
@aoles
Copy link
Member Author

aoles commented Jun 12, 2018

Geocoding API uses yet another error response format.

{
  "geocoding": {
    "version": "0.2",
    "attribution": "/v1/attribution",
    "query": {
      "size": 10,
      "private": false,
      "lang": {
        "name": "English",
        "iso6391": "en",
        "iso6393": "eng",
        "defaulted": false
      },
      "querySize": 20
    },
    "errors": [
      "invalid param 'text': text length, must be >0"
    ],
    "engine": {
      "name": "Pelias",
      "author": "Mapzen",
      "version": "1.0"
    },
    "timestamp": 1528812928983
  },
  "type": "FeatureCollection",
  "features": []
}

@aoles aoles pinned this issue Apr 8, 2019
@aoles aoles modified the milestones: version 0.2.0, version 0.4 Apr 12, 2019
@aoles aoles unpinned this issue May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
No open projects
version 0.2.0
  
To do
Development

No branches or pull requests

1 participant