Runtime errors don't appear to show up at all (console, print debug, you name it) with the new alpha version while a proper stacktrace is presented in 2.2.0. Is this expected or a known issue?
Yup, known issue. Thanks for filing. Will try to get this fixed for next alpha push.
In the mean-time you can "fix" it by overriding the ExceptionHandler class:
bootstrap(..., [
provide(ExceptionHandler, useClass: BrowserExceptionHandler),
]);
@Injectable()
class BrowserExceptionHandler implements ExceptionHandler {
const BrowserExceptionHandler();
@override
void call(exception, [stackTrace, String reason]) {
window.console.error(ExceptionHandler.exceptionToString(
exception,
stackTrace,
reason,
));
}
}
I'll try to get this shipped as the default in the next version.
Thanks for your prompt response, your fix works and seems adequate for now. This is on me: :beers: :)
Thanks, I was also looking for this.
~~In aplha+1, RTE's are still consumed, even if I provide an ExceptionHandler (as shown in the above example).
I can see errors passing through ng_zone https://github.com/dart-lang/angular2/blob/master/lib/src/core/zone/ng_zone.dart#L218, but seeing no log~~
Fixed by moving provide(ExceptionHandler, useClass: BrowserExceptionHandler) into the bootstrap, intially, I had it provided one child level below the main file
Just to make it clear, still chugging on this one a bit - there were a lot of internal tests that needed to be updated. Still will make it in by 3.0 beta.
Most helpful comment
Yup, known issue. Thanks for filing. Will try to get this fixed for next alpha push.
In the mean-time you can "fix" it by overriding the
ExceptionHandlerclass:I'll try to get this shipped as the default in the next version.