How to handle $resource service errors in AngularJS How to handle $resource service errors in AngularJS angularjs angularjs