Is is possible to throw an own error message in a custom validator?

Check this:
if(!$oUser) throw new sfValidatorError($oValidator, 'unknown');
elseif(sha1($oUser->getSalt() . $aArguments['password']) != $oUser-
>getPassword()) throw new sfValidatorError($oValidator, 'invalid');
else return $oUser;

This is my form:
new sfValidatorCallback(
        array(
                'callback'  => array('kmValidatorSignIn', 'execute'),
                'arguments' => array('password' => sfContext::getInstance()-
>getRequest()->getParameter('sign_in[password]'))
        ),
        array(
                'invalid' => 'The e-mail address or the password is invalid',
                'unknown' => 'There is no user found with this e-mail address'
        )
)

But, helas, I receive this error message when I open the page:
"sfValidatorCallback does not support the following error codes:
'unknown'."

Someone who knows how I can make this own validator error code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to