Currently, when an app makes a rest call via an angular resource, it needs to figure out a way to handle failures and display error messages, we should provide a way do this globally for all rest calls.
Add emr.messages function to emr.js(uicommons module) which is a variation of emr.message(..) function that takes an array of messages, note that the error messages from our rest API already come with the translated message.
Add a new angular module in a separate file that has an angular response interceptor which gets the error object from the response if any, creates an array of the messages(starting with global ones) and then delegates to your new emr.messages function in order to display the error messages as a toast message.
Extra credit for updating existing apps for the manage metadata pages to include the new interceptor.
Below is what the error object in a response would look like