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

12 comments
Date Votes
  • Hi Chaim, 
    Can you try with : 
    _json[0].error.errorStatus 

    and let us know the result. 

    0
  • Youssef Zouhairi

    I just tried that and it still didn't catch an error.

    0
  • 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 ! 

    0
  • Youssef Zouhairi

    Thanks for the efforts but that didn't work neither.

    The response I'm getting back from the server is 

    [
        {
            "orderId": "",
            "orderStatus": null,
            "error": {
                "errorStatus": "MISSING_ORDER_ID",
                "localizedErrorMessage": "Order Id is not specified"
            }
        }
    ]

    Celigo is the one adding all that _json in front.

    I also tried with 0.error and it just won't catch an error :(

    0
  • 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
      }
    ]

    0
  • 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 :(

    0
  • 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.

    0
  • Youssef Zouhairi 

    Here's the log from the debug connection

    2023-10-20T01:14:22.515Z feb13123fdc64d6590481fa8c23f2341 import 65302ba4095ce142786b4a02
    {"headers":{"date":"Fri, 20 Oct 2023 01:14:22 GMT","content-type":"application/json","transfer-encoding":"chunked","connection":"close","cache-control":"no-cache, private","access-control-allow-origin":"*","cf-cache-status":"DYNAMIC","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=GUK3Xm%2Ftkiv1UE3u45DluAEe3uRM2gj1kabwQ60Iy0wIU%2Ba0LMkVWALjySNnPe4tOkb2j3PdOhz6zTbBR1FG9fsqbJzhS2cmPF%2FB9xlfcHnZ%2BhkqFSQT4VxIYTC1C%2Bk8QrXdAm1RzpQslAOS3OA%2FrEixQjM%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}","nel":"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}","strict-transport-security":"max-age=15552000; includeSubDomains","server":"cloudflare","cf-ray":"818d67514e8838a4-IAD"},"body":"[{\"orderId\":\"\",\"orderStatus\":null,\"error\":{\"errorStatus\":\"MISSING_ORDER_ID\",\"localizedErrorMessage\":\"Order Id is not specified\"}}]"}
    0
  • 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.

    0
  • 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. 

    0
  • Changing this to a operator/value pair of options would be a nice enhancement :)

    1
  • 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.

     

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post