Unbound error messages in models

I have a form model, a login form, with username & password. When the username/password is wrong I’d like to attach an error like “Incorrect user or password” to the model but addError/s only allows error messages that are bound to a field and in this case it doesn’t make sense to bound the error to either username or password.

Looking inside the code I don’t see any possibility to add unbound error messages. Anyone else felt the need of such error messages?

Thanks,

-soso

Easy peasy. Just pass a blank string as the first argument:

$model->addError(’’,‘Invalid user name and/or password’);