So, I want to made REST JSON API for my web app. It will be used by mobile apps, other web apps, etc. I have problem with ActiveRecord validation errors - it seems like they have no error codes, only messages. Of course, in case of error, I can return 422 HTTP status + error messages in JSON response body, but it seems to be better, if every error will have its own error code (50 for blank user name, 51 for blank password, etc) which will be returned in response body. Is it possible to implement in Rails or you can suggest other ways of error reporting?