Error management
XUND API has a parseable Error response type. It’s not guaranteed that this response type will be used in all different types of errors, but most of the cases are covered by this error management method.
Client apps need to be resistant to different kinds of error response structures. The below-described error structure is not guaranteed.
Error logical types
XUND API does not have any errors that can be caused by the end-users. Therefore it’s not suggested to show the users any information directly from the error responses, because end-users can not fix these issues.
The API requires the following of strict principles and the client applications should guarantee the following of these rules. If the API sends an error, that can be caused by the not proper integration.
XUND distinguishes 3 different error logical types. See them below.
Integration error
Integration errors can occur when the client application doesn’t integrate the API properly. The API has some constraints that need to be followed. If any of these constraints are not followed the API will send an error.
Example:
The client tries to answer a question with the id of an answer that doesn’t belong to the question.
{
"error": "Bad Request",
"customType": "INVALID_ANSWER",
"details": {
"description": "The provided answer (b23eb6b5-fc24-4a49-bf7d-ab695c8f04a11) is not acceptable for the question (ea68ba44-ed8b-4cf5-8270-bcafc56c4338). It's probably not in the option list."
}
}
Internal server error
If the client application receives an internal server error, that’s most probably an issue on XUND’s side. If this type of error was received by your client, please contact our support team.
check id
errorCode (“XAG075“ in the example below)
Example:
{
"error": "Internal Server Error",
"details": {
"errorCode": "XAG075"
}
}
Unknown error
Unknown errors are typically errors on the infrastructure level. Our system is not able to process issues in all layers, therefore the client application might receive an error not parsed to our error response type.
Example:
One of our cloud service providers has network issues, therefore the client has no access to the API.
Error response sturcture
Property name | Property type | Property description |
---|---|---|
| string | Standard Http error name (e.g: Forbidden, Conflict, etc.) |
| If the issue is caused probably by the client application (e.g Invalid parameter sent) the error response will include customType. CustomType is an enum thats name is readable and helps to understand the problem | |
| More information about the error. See type definition for more info |
CustomErrorData
Property name | Property type | Property description |
---|---|---|
| string? | Error code that refers to an internal system issue |
| string? | Description of the error. Should be used for development purposes only, do not show to end-users |
| any? | Additional data about the error that can help fix the problem |