# Kong EXIT Transformer

**URL:** <https://discuss.konghq.com/t/kong-exit-transformer/10581>\
**Category:** General\
**Created:** [August 26, 2022, 8:04am UTC](https://discuss.konghq.com/t/kong-exit-transformer/10581 "2022-08-26T08:04:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aabalaa1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/aabalaa1/32/3602_2.png) [@aabalaa1](https://discuss.konghq.com/u/aabalaa1)\
**Post date:** [August 26, 2022, 8:04am UTC](https://discuss.konghq.com/t/kong-exit-transformer/10581/1 "2022-08-26T08:04:27Z")

</div>

I am using Kong exit transformer in Kong API gateway and change the output status code based on body data condition (in config.function) but it is throwing error…Is this right plugin to change status code or I need to use response transformer…Please help me to fix this.

Wrote a code like this

## Option-1

return function (status, body) if body.code==99 then status =404 end return status,body end

## Option 2

return function (data) if data.code==99 then status =404 end return data end

But it is showing schema violation. I am not sure what is the error here. Please throw some light on this.

---

<div class="post-metadata">

**Author:** ![debianmaster](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/debianmaster/32/3730_2.png) [@debianmaster](https://discuss.konghq.com/u/debianmaster)\
**Post date:** [November 30, 2022, 4:28pm UTC](https://discuss.konghq.com/t/kong-exit-transformer/10581/2 "2022-11-30T16:28:14Z")

</div>

I have same error. did you find any fix? looks like docs are outdated
