New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(test): Test errors aren't being propagated in gulp test.unit.js (possibly other tasks) #2570
Comments
Could this help ? #2102 (not sure if it has been merged and if not why). 👍 to fix this, very annoying |
The version of TypeScript we're using is @alexeagle's fork which declares |
One potential fix is to require that every subclass of |
For subclasses of Error, initializing classes without providing a message to super() would cause any messages to be suppressed from logged errors. This fix provides an initial message to super(). Fixes angular#2570
I opened a PR with a unit test for JS. #2580 I just call super with the same logic from further down in the constructor where the initial message is generated. This approach may be flawed, in that if the provided function would ever output an empty string (or undefined), the eventual message may still not be logged. |
For subclasses of Error, initializing classes without providing a message to super() would cause any messages to be suppressed from logged errors. This fix provides an initial message to super(). Fixes angular#2570
The stack property of BaseException was previously being set in the constructor based on the provided message, but subclasses of BaseException would change the message after constructing the error. This change implements stack as a getter of BaseException, deferring the creation of the stack until it is asked for. Fixes angular#2570
Closing issue in favor of #2606 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
See this job for example: https://travis-ci.org/angular/angular/jobs/67065781
If I debug the code, I see the actual error being caught and re-thrown through
InstantiationError
is "Cannot read property 'fromArray' of undefined", an error I immediately know how to fix.I tinkered with it, and it looks like the problem is when calling
super()
in subclass of BaseException without a message, any message that would be added after callingsuper
gets lost. If I pass an arbitrary string to super here: https://github.com/angular/angular/blob/master/modules/angular2/src/di/exceptions.ts#L40 then a better message is displayed. This may be an issue in the underlying engine, and seems related to microsoft/TypeScript#1168CC: @alexeagle who has looked at this TS issue before.
The text was updated successfully, but these errors were encountered: