@@ -192,7 +192,12 @@ function shallowClearAndCopy(src, dst) {
192192 * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
193193 * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
194194 * `response` and `responseError`. Both `response` and `responseError` interceptors get called
195- * with `http response` object. See {@link ng.$http $http interceptors}.
195+ * with `http response` object. See {@link ng.$http $http interceptors}. In addition, the
196+ * resource instance or array object is accessible by the `resource` property of the
197+ * `http response` object.
198+ * Keep in mind that the associated promise will be resolved with the value returned by the
199+ * response interceptor, if one is specified. The default response interceptor returns
200+ * `response.resource` (i.e. the resource instance or array).
196201 * - **`hasBody`** - `{boolean}` - allows to specify if a request body should be included or not.
197202 * If not specified only POST, PUT and PATCH requests will have a body.
198203 *
@@ -267,8 +272,7 @@ function shallowClearAndCopy(src, dst) {
267272 * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
268273 * rendering until the resource(s) are loaded.
269274 *
270- * On failure, the promise is rejected with the {@link ng.$http http response} object, without
271- * the `resource` property.
275+ * On failure, the promise is rejected with the {@link ng.$http http response} object.
272276 *
273277 * If an interceptor object was provided, the promise will instead be resolved with the value
274278 * returned by the interceptor.
@@ -776,6 +780,9 @@ angular.module('ngResource', ['ng']).
776780 response . resource = value ;
777781
778782 return response ;
783+ } , function ( response ) {
784+ response . resource = value ;
785+ return $q . reject ( response ) ;
779786 } ) ;
780787
781788 promise = promise [ 'finally' ] ( function ( ) {
0 commit comments