05-20-2022 12:13 AM
Hello,
So I created an API specification with these error responses.
‘400’:
description: Bad request. ID must be an integer
‘401’:
description: Authorization information is missing or invalid
headers: {}
content: {}
‘404’:
description: Not found
‘500’:
description: Interal server error (500)
When I uploaded the spec into snaplogic and changed the pipeline I want it to fetch data from SQL server select with given ID. I want to reroute the error when the ID is not found.
But when I do that I still get on the API call the Server error 500 form the snap itself of snaplogic and not from the reroute or from the specification defined error response
Does someone know why it does not reroute the error to my custom error view or the response code from my api specification
Solved! Go to Solution.
05-20-2022 05:39 AM
From the error you posted, the Map data snap is looking for $ID but $ID does not exist in the document stream, check your input doc values
05-20-2022 05:39 AM
From the error you posted, the Map data snap is looking for $ID but $ID does not exist in the document stream, check your input doc values
05-22-2022 10:06 PM
Hi jcornelius, Yeah I saw I forget to change that but there was also something else. I’m now investigating it and if I don’t find it I will post the correct topic. Thanks for the info.
05-20-2022 05:53 AM
I agree with @jcornelius, The snap with label “Map data” is failing because it’s not receiving the ID field. Basing on your explanation, the ID field should be in the “original” object, so you should map $original.ID
05-20-2022 06:36 AM
JFYI to trap error I used the $statusCode