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

test($http): ensure json deserialization errors are forwarded to erro… #15689

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Feb 8, 2017

…r handler

Since e13eeab,
errors thrown from onFulfilled and onRejected handlers are passed to the regular http
error handlers. Before this, JSON deserialization errors lead to hard application errors, and could
not be handled by application code. This behavior was introduced in 7b6c1d0, and originally, a malformed JSON string was forwarded
as the data to the http success response handler.

This commit adds a specifc test case, even though the behavior is unlikely to break in the future without
a change in the $q rejection handling.

Related #11433

…r handler

Since angular@e13eeab,
errors thrown from onFulfilled and onRejected handlers are passed to the regular http
error handlers. Before this, JSON deserialization errors lead to hard application errors, and could
not be handled by application code. This behavior was introduced in angular@7b6c1d0, and originally, a malformed JSON string was forwarded
as the data to the http success response handler.

This commit adds a specifc test case, even though the behavior is unlikely to break in the future without
a change in the $q rejection handling.

Related angular#11433
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Narretz Narretz merged commit ba8b924 into angular:master Feb 8, 2017
Narretz added a commit that referenced this pull request Feb 8, 2017
…r handler

Since e13eeab,
errors thrown from onFulfilled and onRejected handlers are passed to the regular http
error handlers. Before this, JSON deserialization errors lead to hard application errors, and could
not be handled by application code. This behavior was introduced in 7b6c1d0, and originally, a malformed JSON string was forwarded
as the data to the http success response handler.

This commit adds a specifc test case, even though the behavior is unlikely to break in the future without
a change in the $q rejection handling.

Related #11433
Closes #15689
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
…r handler

Since angular@e13eeab,
errors thrown from onFulfilled and onRejected handlers are passed to the regular http
error handlers. Before this, JSON deserialization errors lead to hard application errors, and could
not be handled by application code. This behavior was introduced in angular@7b6c1d0, and originally, a malformed JSON string was forwarded
as the data to the http success response handler.

This commit adds a specifc test case, even though the behavior is unlikely to break in the future without
a change in the $q rejection handling.

Related angular#11433
Closes angular#15689
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants