sending validation error in http response of published REST API

I have a published REST API with import and export mappings tied to entities – all  is fine. But In instances when the Microflow throws exceptions, instead of sending back httpresponse code of 500, I would like to construct a error JSON payload and still send http code of 200 so that processing application logic can get better sense of the error instead of doing exception handling, Anyone knows how to go about doing this in Mendix?
1 answers

You need to put custom error handling within your microflow and still create whichever object you need to supply in your response.