This repository has been 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.5k
provide isError and use it in place of instanceof Error #15868
Milestone
Comments
I don't think it makes sense to complicate things unless there is a reproducible, valid usecase, which makes it worth it. |
this is an error passed from another context, eg another frame, or webworker |
OK, sounds reasonable. Any idea where |
Let's move the discussion to #15872. |
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 30, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 30, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 30, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 30, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 30, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Mar 31, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 3, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 3, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 3, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 18, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 27, 2017
graingert
pushed a commit
to graingert/angular.js
that referenced
this issue
Apr 27, 2017
12345678901234567890123456789012345678901234567890123456789012345678901234567890 Errors thrown from different contexts (such as an iframe or webworker) are not detected as Error instances and handled accordingly. This commit fixes it by introducing an isError() helper, that is able to correctly detect such instances. Fixes angular#15868
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a ...
Current behavior:
angular sometimes stringifies unhandled rejections, even if they're errors.
Expected / new behavior:
Angular should pass them on to the correct excetion handler
Minimal reproduction of the problem with instructions:
Difficult to reproduce
Angular version: 1.x.y
1.6.3
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
Anything else:
Provide angular.isError:
MIT from https://github.com/yefremov/iserror/blob/master/index.js
and use it wherever instanceof Error was used.
The text was updated successfully, but these errors were encountered: