fix(errors): [2/2] Rename Exception to Error; remove from public API
BREAKING CHANGE: Exceptions are no longer part of the public API. We don't expect that anyone should be referring to the Exception types. ExceptionHandler.call(exception: any, stackTrace?: any, reason?: string): void; change to: ErrorHandler.handleError(error: any): void;
This commit is contained in:

committed by
Victor Berchet

parent
86ba072758
commit
7c07bfff97
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {BaseException} from '@angular/core';
|
||||
|
||||
import {ListWrapper} from '../facade/collection';
|
||||
import {isPresent} from '../facade/lang';
|
||||
@ -104,7 +103,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
||||
}
|
||||
currCtx = currCtx.parent;
|
||||
}
|
||||
throw new BaseException(`Not declared variable ${expr.name}`);
|
||||
throw new Error(`Not declared variable ${expr.name}`);
|
||||
}
|
||||
visitReadVarExpr(ast: o.ReadVarExpr, ctx: _ExecutionContext): any {
|
||||
var varName = ast.name;
|
||||
@ -121,7 +120,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
||||
varName = CATCH_STACK_VAR;
|
||||
break;
|
||||
default:
|
||||
throw new BaseException(`Unknown builtin variable ${ast.builtin}`);
|
||||
throw new Error(`Unknown builtin variable ${ast.builtin}`);
|
||||
}
|
||||
}
|
||||
var currCtx = ctx;
|
||||
@ -131,7 +130,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
||||
}
|
||||
currCtx = currCtx.parent;
|
||||
}
|
||||
throw new BaseException(`Not declared variable ${varName}`);
|
||||
throw new Error(`Not declared variable ${varName}`);
|
||||
}
|
||||
visitWriteKeyExpr(expr: o.WriteKeyExpr, ctx: _ExecutionContext): any {
|
||||
var receiver = expr.receiver.visitExpression(this, ctx);
|
||||
@ -163,7 +162,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
||||
result = receiver.bind(args[0]);
|
||||
break;
|
||||
default:
|
||||
throw new BaseException(`Unknown builtin method ${expr.builtin}`);
|
||||
throw new Error(`Unknown builtin method ${expr.builtin}`);
|
||||
}
|
||||
} else {
|
||||
result = receiver[expr.name].apply(receiver, args);
|
||||
@ -281,7 +280,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
||||
case o.BinaryOperator.BiggerEquals:
|
||||
return lhs() >= rhs();
|
||||
default:
|
||||
throw new BaseException(`Unknown operator ${ast.operator}`);
|
||||
throw new Error(`Unknown operator ${ast.operator}`);
|
||||
}
|
||||
}
|
||||
visitReadPropExpr(ast: o.ReadPropExpr, ctx: _ExecutionContext): any {
|
||||
|
Reference in New Issue
Block a user