-
Notifications
You must be signed in to change notification settings - Fork 408
v0.7+ - custom Error classes do not work as expected #546
Comments
The reason is ZoneAwareError override the global Error so the error prototype is NativeError's prototype, I would like to try to fix this one. |
Re-opening this bug as the fix was reverted. This change broke an assumption that calling |
…otype chain and can be called without new
…typescript to 2.1.4
Thanks all for the fix. I can see a lot of work and thought has gone into it. Any idea when this will be available for release? This is the only thing stopping me from updating a project which is stuck on rc.4 to the latest Angular release. |
v0.7.5 has been released just for you. :-)
…On Wed, Jan 11, 2017 at 1:13 AM, Michael Bromley ***@***.***> wrote:
Thanks all for the fix. I can see a lot of work and thought has gone into
it.
Any idea when this will be available for release? This is the only thing
stopping me from updating a project which is stuck on rc.4 to the latest
Angular release.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#546 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG1T4kS-biKLCaiIfOdSPp5kXhTP030ks5rRJ1OgaJpZM4LOMBh>
.
|
This stopped working correctly using class in a typescript file on [email protected] and up until 0.8.20. https://stackblitz.com/edit/angular-naymwh?embed=1&file=src/main.ts This is the basic tour of heroes example where I've added the testing code from the plunkr above to the main.ts. Check the console. |
@akaztp , I don't think it is a |
Thank you for your answer @JiaLiPassion |
@akaztp , in older version of import `zone.js/dist/zone-error`; in your import `zone.js/dist/zone`;
import `zone.js/dist/zone-error`; |
Zone.js version: 0.7.2
Setup:
Expected: logs
true
Actual: logs
false
-error
is an instance ofError
, rather thanMyError
when zone.js is loaded in the app.Demo: https://plnkr.co/edit/kSKVeuhIrMcluK1D9JSl?p=preview
Look in the console to see the erroneous behaviour, and then comment out the script tag including zone.js; and the correct behaviour will be observed in the console.
Replacing the version in the <script> tag with 0.6.26 in the above Plunker demo demonstrates correct behaviour - so this bug was introduced with v0.7+ it seems.
The text was updated successfully, but these errors were encountered: