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

fix($compile): throw error in $onChanges immediately #16492

Merged
merged 2 commits into from
Mar 22, 2018

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Mar 16, 2018

This brings it in line with how we throw errors in a digest cycle.

Closes #15578

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Fix/Feature: Docs have been added/updated
  • Fix/Feature: Tests have been added; existing tests pass

Other information:

@@ -1562,14 +1562,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
try {
onChangesQueue[i]();
} catch (e) {
errors.push(e);
Copy link
Member

Choose a reason for hiding this comment

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

You can get rid of the errors variable altogether.

@Narretz Narretz force-pushed the fix-onchanges-error branch from 5a80436 to 45dd445 Compare March 20, 2018 11:04
@Narretz Narretz merged commit 983e27b into angular:master Mar 22, 2018
@Narretz Narretz deleted the fix-onchanges-error branch March 22, 2018 09:37
Narretz added a commit that referenced this pull request Apr 12, 2018
This brings it in line with how we throw errors in a digest cycle,
and also avoids throwing an array.

Closes #15578
Closes #16492
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.

Errors throw from $onChanges result in an array passed to $exceptionHandler
3 participants