Given a RESTful API, that receive parameters, send them to the business tier, and return the result the user. Suppose an error occurred in the request (parameters error or logic error etc.). The business tier throws an exception. The RESTful API should catch it, and send the error that occurred to the user that perform the invalid request.
It made me wonder... If the RESTful API should return an error code, who needs to manages the codes numbers (in the software design)?
Or perhaps it's better to use error keys (short error string, like 'invalidUser')?