Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

bug($resource): promise not resolved with value returned by responseErrorInterceptor #14837

Closed
@gkalpak

Description

@gkalpak

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
Since 71cf28c (landed in master only), when there is either a responseError interceptor, the promise returned by a $resource instance action (or exposed as instance.$promise) is always resolved with the original response, instead of being fulfilled (resolved or rejected) with the value returned by the interceptor.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
Demo (running with 1.5.7 - change versions to snapshot to see the issue)

  • 1.5.7: The promise is rejected with the value returned by the responseError interceptor.
  • snapshot: The promise is resolved (instead of rejected) with the original response (instead of the value returned by the responseError interceptor).

What is the expected behavior?
Behavior on snapshot (eventual 1.6.x) should be the same as on 1.5.x.

What is the motivation / use case for changing the behavior?
Fix a regression.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Works on 1.5.x. Broken on snapshot (eventual 1.6.x).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions