How to throw exception in published rest microflow

1
How can I deliberately throw an error in the microflow published as a rest service. In the microflow xml input is parsed to non persistable entities based on a xsd schema. When parsing the xml fails, I need the rest service to throw either a http 500 exception or a custom exception. In the software consuming the rest service, I cannot use the httpresponse body or headers.
asked
2 answers
0

The community commons has a java action ThrowWebserviceException. May be you could use this.

Regards,

Ronald

answered
0

There is a built in java action for that throwRestServiceException.

See https://github.com/mendix/restservices#publish

It can be used safely inside webservices operations as well, so that you can apply the same error handling in both implementations

answered