fix(exception_handler): fix error messages of wrapped exceptions

Closes #4117
This commit is contained in:
vsavkin
2015-09-10 15:25:36 -07:00
committed by Victor Savkin
parent 892d2b9652
commit f6cc573687
137 changed files with 339 additions and 349 deletions

View File

@ -1,4 +1,5 @@
import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang';
import {isPresent, isBlank, StringWrapper} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {ChangeDetectionUtil} from './change_detection_util';
import {ChangeDetectorRef} from './change_detector_ref';

View File

@ -13,14 +13,7 @@ import {
} from './interfaces';
import {Injector, Inject, Injectable, OpaqueToken, Optional, Binding} from 'angular2/src/core/di';
import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {
CONST,
CONST_EXPR,
isPresent,
BaseException,
assertionsEnabled
} from 'angular2/src/core/facade/lang';
import {CONST, CONST_EXPR, isPresent, assertionsEnabled} from 'angular2/src/core/facade/lang';
export * from './parser/ast';
export {Lexer} from './parser/lexer';

View File

@ -1,10 +1,5 @@
import {
BaseException,
Type,
isBlank,
isPresent,
StringWrapper
} from 'angular2/src/core/facade/lang';
import {Type, isBlank, isPresent, StringWrapper} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {AbstractChangeDetector} from './abstract_change_detector';
@ -70,7 +65,7 @@ export class ChangeDetectorJITGenerator {
${this.generateSource()}
return function(dispatcher) {
return new ${this.typeName}(dispatcher);
}
}
`;
return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName,
factorySource)(AbstractChangeDetector, ChangeDetectionUtil);

View File

@ -1,11 +1,5 @@
import {
CONST_EXPR,
isPresent,
isBlank,
BaseException,
Type,
StringWrapper
} from 'angular2/src/core/facade/lang';
import {CONST_EXPR, isPresent, isBlank, Type, StringWrapper} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {ProtoRecord} from './proto_record';
import {ChangeDetectionStrategy, isDefaultChangeDetectionStrategy} from './constants';

View File

@ -1,17 +1,12 @@
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {
BaseException,
Json,
StringWrapper,
isPresent,
isBlank
} from 'angular2/src/core/facade/lang';
import {Json, StringWrapper, isPresent, isBlank} from 'angular2/src/core/facade/lang';
import {CodegenNameUtil} from './codegen_name_util';
import {codify, combineGeneratedStrings, rawString} from './codegen_facade';
import {ProtoRecord, RecordType} from './proto_record';
import {BindingTarget} from './binding_record';
import {DirectiveRecord} from './directive_record';
import {ChangeDetectionStrategy} from './constants';
import {BaseException} from 'angular2/src/core/facade/exceptions';
/**
* Class responsible for providing change detection logic for chagne detector classes.

View File

@ -1,4 +1,5 @@
import {CONST, BaseException} from 'angular2/src/core/facade/lang';
import {CONST} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {
isListLikeIterable,
iterateListLike,

View File

@ -1,12 +1,6 @@
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {
stringify,
looseIdentical,
isJsObject,
CONST,
isBlank,
BaseException
} from 'angular2/src/core/facade/lang';
import {stringify, looseIdentical, isJsObject, CONST, isBlank} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ChangeDetectorRef} from '../change_detector_ref';
import {KeyValueDiffer, KeyValueDifferFactory} from '../differs/keyvalue_differs';

View File

@ -1,4 +1,5 @@
import {isBlank, isPresent, BaseException, CONST} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent, CONST} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {ChangeDetectorRef} from '../change_detector_ref';
import {Binding, SkipSelfMetadata, OptionalMetadata, Injectable} from 'angular2/src/core/di';

View File

@ -1,4 +1,5 @@
import {isBlank, isPresent, BaseException, CONST} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent, CONST} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {ChangeDetectorRef} from '../change_detector_ref';
import {Binding, SkipSelfMetadata, OptionalMetadata, Injectable} from 'angular2/src/core/di';

View File

@ -1,10 +1,5 @@
import {
isPresent,
isBlank,
BaseException,
FunctionWrapper,
StringWrapper
} from 'angular2/src/core/facade/lang';
import {isPresent, isBlank, FunctionWrapper, StringWrapper} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {AbstractChangeDetector} from './abstract_change_detector';

View File

@ -1,4 +1,4 @@
import {BaseException} from "angular2/src/core/facade/lang";
import {BaseException, WrappedException} from "angular2/src/core/facade/exceptions";
/**
* An error thrown if application changes model breaking the top-down data flow.
@ -21,7 +21,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti
*
* This error wraps the original exception, this is done to attach expression location information.
*/
export class ChangeDetectionError extends BaseException {
export class ChangeDetectionError extends WrappedException {
/**
* Location of the expression.
*/

View File

@ -1,4 +1,4 @@
import {isBlank, isPresent, FunctionWrapper, BaseException} from "angular2/src/core/facade/lang";
import {isBlank, isPresent, FunctionWrapper} from "angular2/src/core/facade/lang";
import {Map, ListWrapper, StringMapWrapper} from "angular2/src/core/facade/collection";
export class AST {

View File

@ -1,12 +1,7 @@
import {Injectable} from 'angular2/src/core/di/decorators';
import {ListWrapper, SetWrapper} from "angular2/src/core/facade/collection";
import {
NumberWrapper,
StringJoiner,
StringWrapper,
BaseException,
isPresent
} from "angular2/src/core/facade/lang";
import {NumberWrapper, StringJoiner, StringWrapper, isPresent} from "angular2/src/core/facade/lang";
import {BaseException} from 'angular2/src/core/facade/exceptions';
export enum TokenType {
Character,

View File

@ -1,4 +1,5 @@
import {isPresent, BaseException} from 'angular2/src/core/facade/lang';
import {isPresent} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
export class Locals {

View File

@ -1,5 +1,6 @@
import {Injectable} from 'angular2/src/core/di/decorators';
import {isBlank, isPresent, BaseException, StringWrapper} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent, StringWrapper} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {
Lexer,
@ -51,8 +52,7 @@ var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g;
class ParseException extends BaseException {
constructor(message: string, input: string, errLocation: string, ctxLocation?: any) {
super(`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`, null, null,
ctxLocation);
super(`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`);
}
}

View File

@ -1,5 +1,3 @@
import {ABSTRACT, BaseException, CONST, Type} from 'angular2/src/core/facade/lang';
/**
* To create a Pipe, you must implement this interface.
*

View File

@ -1,4 +1,4 @@
import {BaseException} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ProtoChangeDetector, ChangeDetector} from './interfaces';
import {coalesce} from './coalesce';

View File

@ -1,4 +1,5 @@
import {BaseException, Type, isBlank, isPresent, isString} from 'angular2/src/core/facade/lang';
import {Type, isBlank, isPresent, isString} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {