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,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {BaseException, Inject, Injectable, OpaqueToken, RenderComponentType, Renderer, RootRenderer, ViewEncapsulation} from '@angular/core';
|
||||
import {Inject, Injectable, OpaqueToken, RenderComponentType, Renderer, RootRenderer, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../../core_private';
|
||||
import {StringMapWrapper} from '../facade/collection';
|
||||
@ -79,7 +79,7 @@ export class DomRenderer implements Renderer {
|
||||
if (isString(selectorOrNode)) {
|
||||
el = getDOM().querySelector(this._rootRenderer.document, selectorOrNode);
|
||||
if (isBlank(el)) {
|
||||
throw new BaseException(`The selector "${selectorOrNode}" did not match any elements`);
|
||||
throw new Error(`The selector "${selectorOrNode}" did not match any elements`);
|
||||
}
|
||||
} else {
|
||||
el = selectorOrNode;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {BaseException, Inject, Injectable, NgZone, OpaqueToken} from '@angular/core';
|
||||
import {Inject, Injectable, NgZone, OpaqueToken} from '@angular/core';
|
||||
|
||||
import {ListWrapper} from '../../facade/collection';
|
||||
|
||||
@ -50,7 +50,7 @@ export class EventManager {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
throw new BaseException(`No event manager plugin found for event ${eventName}`);
|
||||
throw new Error(`No event manager plugin found for event ${eventName}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {BaseException, Inject, Injectable, OpaqueToken} from '@angular/core';
|
||||
import {Inject, Injectable, OpaqueToken} from '@angular/core';
|
||||
|
||||
import {isPresent} from '../../facade/lang';
|
||||
|
||||
@ -56,7 +56,7 @@ export class HammerGesturesPlugin extends HammerGesturesPluginCommon {
|
||||
if (!super.supports(eventName) && !this.isCustomEvent(eventName)) return false;
|
||||
|
||||
if (!isPresent((window as any /** TODO #???? */)['Hammer'])) {
|
||||
throw new BaseException(`Hammer.js is not loaded, can not bind ${eventName} event`);
|
||||
throw new Error(`Hammer.js is not loaded, can not bind ${eventName} event`);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AUTO_STYLE, BaseException} from '@angular/core';
|
||||
import {AUTO_STYLE} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, NoOpAnimationPlayer} from '../../core_private';
|
||||
import {StringMapWrapper} from '../facade/collection';
|
||||
@ -86,8 +86,7 @@ function _resolveStyleUnit(
|
||||
if (isNumber(val)) {
|
||||
unit = 'px';
|
||||
} else if (_findDimensionalSuffix(val.toString()).length == 0) {
|
||||
throw new BaseException(
|
||||
'Please provide a CSS unit value for ' + userProvidedProp + ':' + val);
|
||||
throw new Error('Please provide a CSS unit value for ' + userProvidedProp + ':' + val);
|
||||
}
|
||||
}
|
||||
return unit;
|
||||
|
Reference in New Issue
Block a user