feat(lang): added "context" to BaseException

This commit is contained in:
vsavkin
2015-07-22 11:59:16 -07:00
parent 8ad4ad57d1
commit 8ecb632d70
3 changed files with 19 additions and 4 deletions

View File

@ -145,6 +145,11 @@ function _createNgZone(givenReporter: Function): NgZone {
var defaultErrorReporter = (exception, stackTrace) => {
var longStackTrace = ListWrapper.join(stackTrace, "\n\n-----async gap-----\n");
DOM.logError(`${exception}\n\n${longStackTrace}`);
if (exception instanceof BaseException && isPresent(exception.context)) {
print("Error Context:");
print(exception.context);
}
throw exception;
};