03-10-2021 09:07 AM
Is it possible within SnapLogic to configure a pipeline to fail via a Snap but also to return a custom output back to the user (configured via a Mapper snap, e.g.)
I have reviewed the video here: Framework: Error Handling & Retry Patterns and it appears that a SnapLogic pipeline can either:
11-02-2022 01:39 PM
Could you include some more information regarding your implementation and what you’re trying to do? If I understand your question you are trying to check if there were failed insertions. If so, then the task should respond with an error message and a non-200 status code. If that’s correct then you might look at this kind of pipeline.
You can use the JSON Generator to set the failed count, which will determine if there is an error. Here are some additional notes for the 4 key snaps required to get this done.
Set Error
mapper snap will set an error message and status code that the task should return in the HTTP response.status
in the binary document header.When executed as a triggered task, then you should see this kind of response. I removed some headers from the response to make it easier to read.
< HTTP/1.1 500 INTERNAL SERVER ERROR
< Date: Wed, 02 Nov 2022 20:33:46 GMT
< Content-Type: application/json; charset=utf-8
< X-SL-StatusCode: 500
< X-Snapi-pipeline-ruuid: XXXX08ba
...
<
[{"status":500,"error":"oh no!"}]
In the dashboard it’ll show up like this.
Here is an attached pipeline if you’d like to try it out.
exit-example_2022_11_02.slp (9.9 KB)
03-18-2021 07:38 AM
Are you referring to a custom binary header, so you could manipulate the response? If that’s the case, you can use Mapper to map the status and the message, than add a JSON Formatter snap, and add the incoming status and message in a binary header properties.
Understanding Synchronous and Asynchronous Execution of Triggered Tasks
Hope this helps,
Regards,
Bojan Velevski