This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Errors throw from $onChanges result in an array passed to $exceptionHandler #15578
Closed
jbedard opened this issue
Jan 4, 2017
· 2 comments
· Fixed by #16492, javascript-indonesias/angular.js#71 or angular-indonesia/angular.js#128
Closed
Errors throw from $onChanges result in an array passed to $exceptionHandler #15578
jbedard opened this issue
Jan 4, 2017
· 2 comments
· Fixed by #16492, javascript-indonesias/angular.js#71 or angular-indonesia/angular.js#128
Comments
The behaviour also seems to be different based on when the error is thrown. Consider this example:
If you run the example above, you will get two errors in console. One is thrown on the initialization of the component, while the second one is thrown when the binding gest updated. The first error is an actual |
Yeah, tbh it seems reasonable to pass each error to the |
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Mar 16, 2018
This brings it in line with how we throw errors in a digest cycle. Closes angular#15578
3 tasks
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Mar 20, 2018
This brings it in line with how we throw errors in a digest cycle. Closes angular#15578
This was referenced Mar 22, 2018
This was referenced Apr 18, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do you want to request a feature or report a bug?
bug?
What is the current behavior?
an error thrown in an
$onChanges
method results in an array being thrown which will result in$exceptionHandler(arrayOfErrors)
What is the expected behavior?
Error
objects are passed to$exceptionHandler
What is the motivation / use case for changing the behavior?
make
$exceptionHandler
more predictable / consistent / follow documentationWhich 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.
1.5+
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Maybe each error in the array is passed to
$exceptionHandler
separately?Maybe the array of errors is wrapped in an
Error
before being thrown?Or document that
$exceptionHandler
might be passed an array?The text was updated successfully, but these errors were encountered: