Validators And Error Codes

I’m working on web service utilizing Yii model validators and faced with pretty weird problem - there is no native and built in way to specify error code.

Of course I could return error code instead of error message and transform it into error message where it’s needed, but I’m just curious did I miss something or Yii truly does not support error codes in validators?

If it does not I probably have to move this topic into "Feature Requests" forum, because the ability to return error code is highly required feature for pretty much all web services.

BTW for object oriented framework like Yii I believe it makes perfect sense to return extendable error object (like exception) instead of string error message and if my memory serves me this is the way Yii 2.0 is going to follow, correct?

P.S. I believe this question has come up already, but I could not find any reasonable solution neither on internet nor on this forum. Please point me to the right place if you know.