title: Override model validate errors
body: <p>I am new to CakePHP.</p>
  
  <p>I would like to use the model validate mechanism, but I'm having trouble overriding the errors that are displayed. I am building an API where all the views need to be rendered in JSON and I have a JSON format that all errors need to output as. I've defined a custom AppError class and I have successfully be able to define custom errors in this format there.</p>
  
  <p>Is there a way to use the AppError class to override the output of the error messages coming from validation?</p>
  
  <p>Thanks.</p>