# Path to error field in HTTP response body

**URL:** <https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332>\
**Category:** Integrator.io\
**Tags:** http, error-handling, json\
**Created:** [October 18, 2023, 10:45pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332 "2023-10-18T22:45:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 18, 2023, 10:45pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/1 "2023-10-18T22:45:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![youssefzouhairi](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/youssefzouhairi/32/7087_2.png) [@youssefzouhairi](https://connective.celigo.com/u/youssefzouhairi)\
**Post date:** [October 19, 2023, 2:46am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/2 "2023-10-19T02:46:04Z")

</div>

Hi Chaim,   
Can you try with :   
\_json[0].error.errorStatus   
  
and let us know the result.

---

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 19, 2023, 11:22am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/3 "2023-10-19T11:22:44Z")

</div>

@youssefzouhairi

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

---

<div class="post-metadata">

**Author:** ![youssefzouhairi](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/youssefzouhairi/32/7087_2.png) [@youssefzouhairi](https://connective.celigo.com/u/youssefzouhairi)\
**Post date:** [October 19, 2023, 6:35pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/4 "2023-10-19T18:35:26Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 19, 2023, 7:18pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/5 "2023-10-19T19:18:13Z")

</div>

@youssefzouhairi

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

---

<div class="post-metadata">

**Author:** ![youssefzouhairi](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/youssefzouhairi/32/7087_2.png) [@youssefzouhairi](https://connective.celigo.com/u/youssefzouhairi)\
**Post date:** [October 19, 2023, 7:30pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/6 "2023-10-19T19:30:20Z")

</div>

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 :

 ![5301043caa20740200000001-925fc63cb3734920acde078d24153499.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/8/888f7b7b9faf29a7d82cc738e0bf02f573f1c180.png)

And this is the payload I get back from the system :   
[  
 {  
 "status": "failure",  
 "action": "INSERT",  
 "salesOrderId": "11111",  
 "message": "duplicate salesOrderId: 11111",  
 "details": null  
 }  
]

---

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 19, 2023, 7:35pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/7 "2023-10-19T19:35:56Z")

</div>

@youssefzouhairi

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

---

<div class="post-metadata">

**Author:** ![youssefzouhairi](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/youssefzouhairi/32/7087_2.png) [@youssefzouhairi](https://connective.celigo.com/u/youssefzouhairi)\
**Post date:** [October 19, 2023, 7:52pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/8 "2023-10-19T19:52:07Z")

</div>

@chaimpaperman  
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.

---

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 20, 2023, 1:18am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/9 "2023-10-20T01:18:23Z")

</div>

@youssefzouhairi

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\"}}]"}
```

---

<div class="post-metadata">

**Author:** ![chaimpaperman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaimpaperman](https://connective.celigo.com/u/chaimpaperman)\
**Post date:** [October 20, 2023, 1:24am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/10 "2023-10-20T01:24:55Z")

</div>

@youssefzouhairi

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.

---

<div class="post-metadata">

**Author:** ![youssefzouhairi](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/youssefzouhairi/32/7087_2.png) [@youssefzouhairi](https://connective.celigo.com/u/youssefzouhairi)\
**Post date:** [October 20, 2023, 1:45am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/11 "2023-10-20T01:45:09Z")

</div>

@chaimpaperman

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.

---

<div class="post-metadata">

**Author:** ![steveklett](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@steveklett](https://connective.celigo.com/u/steveklett)\
**Post date:** [October 20, 2023, 2:58am UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/12 "2023-10-20T02:58:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![balasubramanianmahad](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@balasubramanianmahad](https://connective.celigo.com/u/balasubramanianmahad)\
**Post date:** [October 20, 2023, 12:00pm UTC](https://connective.celigo.com/t/path-to-error-field-in-http-response-body/332/13 "2023-10-20T12:00:01Z")

</div>

@chaimpaperman Great to know that your issue has been resolved.

@steveklett 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](https://docs.celigo.com/hc/en-us/articles/6524823504411-See-what-s-coming-and-submit-ideas-in-the-Product-portal).
