Error handling
Handling errors returned from HTTP API endpoints
Since any API endpoint can return an error during an execution of a scenario, Make provides methods to handle errors and keep scenarios reliable and functional.
All apps in Make should implement error handling to ensure that users understand the cause of any errors. Error handling should always be customized to the type of error and how the API returns the error.
When the service returns an HTTP error, it is not possible to evaluate it as a success.
Error handling: 401 error

HTTP 4xx and 5xx error handling
When the response returns a 4xx or 5xx HTTP error code, this is automatically considered an error. If the error
directive is not specified, the user will only see the status code that was returned. You should customize the message shown to the user with the error
or error.message
directive.
{
"response": {
"error": {
"type": "RuntimeError",
"message": "[{{statusCode}}] {{body.error.message}}",
"400": {
"type": "DataError",
"message": "[{{statusCode}}] {{body.error.message}}"
},
"500": {
"type": "ConnectionError",
"message": "[{{statusCode}}] {{body.error.message}}"
}
}
}
}
HTTP 2xx and 3xx error handling
Some APIs signal an error with a 200 status code and a flag in the body. In this situation, use the valid
directive to tell the user if the response is valid or not.
{
"response": {
"valid": {
"condition": "{{body.status != 'error'}}"
},
"error": {
"200": {
"message": "{{ifempty(errors(body.message), body.message)}}"
},
"message": "[{{statusCode}}]: {{body.reason}}"
}
}
}
Custom error handling based on status codes
You can further customize what error message will be shown to the user based on the status code. To do that, add your status code to the error
directive.
{
"response": {
"error": {
"message": "Generic error message",
"400": {
"message": "Your request was invalid"
},
"500": {
"message": "The server was not able to handle your request"
}
}
}
}
Available error types
When handling an error, you can specify the type of the error.
UnknownError
RuntimeError
(default)
Primary error type. Execution is interrupted and rolled back.
InconsistencyError
DataError
Incoming data is invalid. If incomplete executions are enabled, execution is interrupted and the state is stored. The user is able to repair the data and resume execution.
RateLimitError
Service responded with rate-limit related error. Applies delay to the next execution of a scenario.
OutOfSpaceError
The user is out of space.
ConnectionError
Connection-related problem. Applies delay to the next execution of a scenario.
InvalidConfigurationError
Configuration-related problem. Deactivates the scenario and notifies the user.
InvalidAccessTokenError
Access token-related problem. Deactivates the scenario and notifies the user.
UnexpectedError
MaxResultsExceededError
IncompleteDataError
Incoming data is incomplete.
DuplicateDataError
Reports error as warning and does not interrupt execution. If incomplete executions are enabled, execution is interrupted and the state is stored. The user is able to repair the data and resume execution.
Error handling with type
{
"response": {
"error": {
"type": "DataError",
"message": "[{{statusCode}}] {{body.message}}"
}
}
}
Last updated