This is a snippet to implement a global interceptor used to handle 403 errors for example

From http://stackoverflow.com/questions/17687804/handling-http-get-and-http-post-errors-in-angularjs