Path to error field in HTTP response body
I have an HTTP connection with a response that looks as such
[
{
"statusCode": 200,
"_json": [
{
"orderId": "",
"orderStatus": null,
"error": {
"errorStatus": "MISSING_ORDER_ID",
"localizedErrorMessage": "Order Id is not specified"
}
}
]
}
]
I am trying to set the Path to error field in HTTP response body to the error object but no matter what I try, it doesn't seem to trigger an error.
I tried
- [0].error.errorStatus
- *.error.errorStatus
- error
but I can't get it to recognize any of these values
0
Comments
Hi Chaim,
Can you try with :
_json[0].error.errorStatus
and let us know the result.
Youssef Zouhairi
I just tried that and it still didn't catch an error.
I just had to deal with the same scenario this morning.
Try with :
0._json[0].error.errorStatus .. hopefully this is the right one this time !
Youssef Zouhairi
Thanks for the efforts but that didn't work neither.
The response I'm getting back from the server is
Celigo is the one adding all that _json in front.
I also tried with 0.error and it just won't catch an error :(
Oh ok ! So can you please retry with 0.error.errorStatus (no brackets around 0).
I just solved the same issue with that , this is how it looks for me :
And this is the payload I get back from the system :
[
{
"status": "failure",
"action": "INSERT",
"salesOrderId": "11111",
"message": "duplicate salesOrderId: 11111",
"details": null
}
]
Youssef Zouhairi
What you have working is exactly what I tried doing and for some unknown reason it doesn't work for me. does your API return a 200 success code?
0.error.errorStatus was my first try and it doesn't work :(
Chaim Paperman
Yes Status Code was 200.
Are you able to see the response in the connection logs (You will have to go to connections and then click 3 dots and on debug connections.
You can then be sure of the response received from the endpoint and build on that.
Youssef Zouhairi
Here's the log from the debug connection
Youssef Zouhairi
OMG - I just figured it out and posting here for anyone that runs into this issue.
It's not enough to populate the Path to error field in HTTP response body field, you also need to populate the Error values field.
Only if both are populated will Celigo throw an error.
There doesn't seem to be any wildcard values for Error values.
Thanks anyways for your help.
Chaim Paperman
Happy to see that the issue is solved !
Yeah , I assumed for a moment that you already had a value in "Error Values" just like in the screenshot I shared. Glad that you caught it at the end.
Changing this to a operator/value pair of options would be a nice enhancement :)
Chaim Paperman Great to know that your issue has been resolved.
Steve Klett Thank you for the suggestion. I would recommend you post any enhancement requests you may think of to the Product portal section of integrator.io. The Celigo Product portal enables you to see the new features and enhancements we're working on or planning for upcoming releases. In addition, you can submit your ideas, vote on others' ideas, and add comments. To know how to post your enhancement requests in Product portal, see See what's coming and submit ideas in the Product portal.
Please sign in to leave a comment.