Errors
Overview
While using the SDK, you may run into an error. Usually, this is caused by an invalid parameter in your implementation.
Here is an example of one error you may run into:
{
"httpStatusCode": 401,
"message": "Invalid destination provided",
"info": { "unknowns": [ "moffdd" ] }
}
This sections explains the error format and messages utilized by Connect.
API Error responses
HTTP status codes do not always provide sufficient information about the cause of an error. For more detailed programmatic handling of errors, responses contain additional JSON fields that describe the error.
Error format
Whenever an API request results in an error, the response will contain both a high-level error class specified by the code and a human-readable summary in the message.
{
"message":"Insufficient funds."
}
Extended error format
In some cases, there is extended information available for clients about why a request has failed. For example, failing to supply a value for a required field1 will result in the following error:
{
"httpStatusCode": 401,
"message": "Invalid destination provided",
"info": { "unknowns": [ "moffdd" ] }
}
List of API Error Codes
HTTP status | Message | Description |
---|---|---|
400 | Request contains invalid parameters | You've provided an invalid parameter. Check info from the response to find out which one. |
401 | Permission not established | You are trying to use a feature that requires a permission not yet granted to you by this user. |
401 | Missing authorization | The authorization token is missing or is no longer valid. |
403 | Account wallet is locked | This wallet can neither send nor receive. The user should reach support to unlock it. |
409 | Request exceeds users global connect spend limit. | The user has reached their Connect limit. Prompt the user to increase their Connect limit from within the HandCash app. |
409 | Insufficient funds. | The user account does not hold enough funds to process the transaction. Prompt the user to top up their account. |
409 | Invalid destination provided | The handle, paymail, or address you provided is invalid. Ensure the destination you're providing is a valid one. |
409 | This app didn't create the requested transaction | You are requesting a transaction made by a different app. |
500 | Internal server error | HandCash has experienced an internal server error, and is unable to process your request. |
503 | External service not available | We are having difficulties connecting to an external service, and are unable to process your request. |
Updated about 1 year ago