On this Page
Table of Contents | ||||
---|---|---|---|---|
|
...
You can adopt standard HTTP response codes and messages to indicate the success or failure of a request, returning specific error responses at different stages of the pipeline. For example, invalid headers result in HTTP response status code 401, and an invalid version results in 406.
[{
“response codes”: [{
“400”: {
“error code”: “4000”,
“error message”: “Malformed request body or missing a required parameter”
}
}, {
“401”: {
“error code”: “4010”,
“error message”: “No valid session key or credentials provided”
}
}]
}]
In the following example, a nested Ultra Pipeline is created to return the contents of the error code lookup file; the nested Ultra Pipeline is called using a Rest GET Snap labeled http error codes. The Mapper Snap labeled as error formatter performs a search on the status code object from the file, returning relevant error codes and message information.
...
Info |
---|
Maximum TriesBy default, if the first run of an Ultra Pipeline fails, SnapLogic attempts to run it for a total of five times. However, you can configure the number of times you want Ultra Tasks from a specific Snaplex to run by configuring the maximum number of allowed retries for an Ultra task. To do so, modify the following parameter in Global Properties in Snaplex Update: |
Error Handling in Asynchronous Ultra Tasks
Ultra Pipelines require a Document type output in the Error Pipeline. The following pipeline provides an example of an error pipeline set up for error handling in asynchronous Ultra Tasks.
...
We add a JSON Formatter (Status Output) after the Mapper with the HTTP status code format.
...
The final Mapper outputs the response as a document.
Download
You can download this sample pipeline to reuse for your Ultra Pipeline:
Attachments | ||||
---|---|---|---|---|
|