This can work if the controller uses a try catch and handles the exception properly passing the error up the chain to an error output from the rest controller.
Personally I hold the errors in an array which is useful when validating a form when you want to show multiple errors from a save attempt.
However I do throw an exception if the model is somehow incorrectly configured. Like a validator method being expected but not defined.
Personally I hold the errors in an array which is useful when validating a form when you want to show multiple errors from a save attempt.
However I do throw an exception if the model is somehow incorrectly configured. Like a validator method being expected but not defined.