[FLOW3-general] How can i catch TYPO3\FLOW3\Persistence\Exception\ObjectValidationFailedException in controllerAction

Pankaj Lele pankaj at lelesys.com
Fri May 4 12:29:54 CEST 2012


Hi Christian,

> You could accept the needed arguments as strings (email, name, pass) and
> add validation annotations to your action, then you have the same result
> as using an object.

Yes this is the right approach, but in case of RestController actions if
the validation fails you get a long exception back-trace as REST API
response and no real JSON output. So how to solve this and let it send
simple JSON response like {"success":false,"message":"propertyX was
required"} ? Probably using the JsonView and/or the proper @format .json
approach?


Thanks in advance!

-- 

With best regards,
Pankaj Lele
---------------------------

CTO & Executive Director
Lelesys Infotech Pvt. Ltd.
Pune/Goa, India

Web: http://www.lelesys.com

[Certified TYPO3 Integrator]


More information about the FLOW3-general mailing list