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

feat($http): pass response status code to data transform functions #10440

Conversation

pkozlowski-opensource
Copy link
Member

Fixes #10324
Closes #6734

@caitp this is an alternative to #6734 discussed today. I'm still not sure what it the best: to pass status code or just success / error flag (like in #6734). The first approach is more flexible but people will have to duplicate the isSuccess "logic".

@googlebot
Copy link

CLAs look good, thanks!

@caitp
Copy link
Contributor

caitp commented Dec 12, 2014

status code makes getting "success" or "failure" very easy. It is much more informative than "success" or "fail"

@caitp
Copy link
Contributor

caitp commented Dec 12, 2014

We could add "transformErrorResponse" and call that if it's available --- but send the status code to both functions

@pkozlowski-opensource
Copy link
Member Author

yeh... not sure... maybe we shouldn't over-thinking this... people were living without this feature for years and their transformResponse was called on error... so I'm not super-keen on changing this.

IMO this is a small thing that we could land in 1.3.x and it would probably cover all the use-cases people might have...

@caitp
Copy link
Contributor

caitp commented Dec 12, 2014

I agree.

@pkozlowski-opensource
Copy link
Member Author

Cool. So if you could quickly review we could land it and call it a day :-)

@caitp
Copy link
Contributor

caitp commented Dec 12, 2014

looks good if travis is green

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Behaviour for resource with both transformResponse and interceptors
3 participants