Model errors Throw UserException

Guys,

Maybe dumb question,

How can I throw ActiveRecords error after validate()?

I’m looking for a simple way to convert all of ActiveRecords errors to UserException.

Not sure what you want to do. something like this?




if (!$model->validate()) {

    throw new InvalidInputException($model->getErrors());

}



Exactly

but there is no InvalidInputException