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
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {MetadataOverride} from '@angular/core/testing';
|
||||
import {BaseException} from '../src/facade/exceptions';
|
||||
import {stringify} from '../src/facade/lang';
|
||||
|
||||
type StringMap = {
|
||||
@ -31,8 +30,7 @@ export class MetadataOverrider {
|
||||
|
||||
if (override.set) {
|
||||
if (override.remove || override.add) {
|
||||
throw new BaseException(
|
||||
`Cannot set and add/remove ${stringify(metadataClass)} at the same time!`);
|
||||
throw new Error(`Cannot set and add/remove ${stringify(metadataClass)} at the same time!`);
|
||||
}
|
||||
setMetadata(props, override.set);
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {BaseException} from '@angular/core';
|
||||
|
||||
import {ResourceLoader} from '../index';
|
||||
import {ListWrapper, Map} from '../src/facade/collection';
|
||||
@ -54,7 +53,7 @@ export class MockResourceLoader extends ResourceLoader {
|
||||
*/
|
||||
flush() {
|
||||
if (this._requests.length === 0) {
|
||||
throw new BaseException('No pending requests to flush');
|
||||
throw new Error('No pending requests to flush');
|
||||
}
|
||||
|
||||
do {
|
||||
@ -76,7 +75,7 @@ export class MockResourceLoader extends ResourceLoader {
|
||||
urls.push(expectation.url);
|
||||
}
|
||||
|
||||
throw new BaseException(`Unsatisfied requests: ${urls.join(', ')}`);
|
||||
throw new Error(`Unsatisfied requests: ${urls.join(', ')}`);
|
||||
}
|
||||
|
||||
private _processRequest(request: _PendingRequest) {
|
||||
@ -97,7 +96,7 @@ export class MockResourceLoader extends ResourceLoader {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new BaseException(`Unexpected request ${url}`);
|
||||
throw new Error(`Unexpected request ${url}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user