I am trying to use $model->save() .. but i can't get the error messages like the documentation instead the error message appears with trace error then the script dies.
for example i am trying to use this code:
$user = new Users();
$user->name = "Name";
if(!$user->save()){
//do stuff if there is an error
}
the problem is that i always get the validation error like this and the script dies and never returns false to enter the if condition :
password is required
#0 ..../UsersController.php(106): Phalcon\Mvc\Model->save()
#1 [internal function]: ....\UsersController->createAction()
#2 [internal function]: Phalcon\Dispatcher->callActionMethod(Object(....\UsersController), 'createAction', Array)
#3 [internal function]: Phalcon\Dispatcher->_dispatch()
#4 [internal function]: Phalcon\Dispatcher->dispatch()
#5 ....\public\index.php(41): Phalcon\Mvc\Application->handle()
#6 {main}**