You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a User of the API when there is a problem with the response I want to get a JSON response and get the error code instead of a server error.
We need to always catch server errors for the API and respond with a valid response and JSON.
This is how an example error could look like
{
"error": {
"message": "what did go wrong",
"type": "Type of Execption (if applicable)",
"code": 500,
}
}
The easiest way to get started on this is to pick one Endpoint. e.g.: https://staging.wazimap-ng.openup.org.za/api/v1/profile/10977/points/themes/?format=json
This already returns a not found but not in the format listed above.
After that, we need be sure that all instances where we can get a server error are caught.
The text was updated successfully, but these errors were encountered:
We need to always catch server errors for the API and respond with a valid response and JSON.
This is how an example error could look like
The easiest way to get started on this is to pick one Endpoint. e.g.:
https://staging.wazimap-ng.openup.org.za/api/v1/profile/10977/points/themes/?format=json
This already returns a not found but not in the format listed above.
After that, we need be sure that all instances where we can get a server error are caught.
The text was updated successfully, but these errors were encountered: