If a request to submit an EBT Element
fails, then the returned Promise rejects with a ForageError
.
{
errors: [
{
httpStatusCode: 400,
code: 'invalid_merchant_account',
message: 'Merchant account FNS number not valid.'
}
]
}
ForageError
A ForageError
is an object with a single errors
key.
Type | Description | |
---|---|---|
errors | array | An array of error objects returned from the Forage API. |
Error objects
The error objects listed in the errors array contain the following fields:
Type | Description | |
---|---|---|
httpStatusCode | 400 401 402 403 404 429 500 502 504 | The HTTP status that the Forage API returns in response to the request. |
code | string | A short string explaining why the request failed. The error code string corresponds to the HTTP status code. |
message | string | A developer-facing message about the error, not to be displayed to customers. |
Error handling examples