refactor(common): cleanup (#11668)

This commit is contained in:
Victor Berchet
2016-09-22 10:34:00 -07:00
committed by Rado Kirov
parent 3a6fcee0e6
commit 0ca971c5bd
7 changed files with 21 additions and 37 deletions

View File

@ -14,15 +14,13 @@ export function unimplemented(): any {
* @stable
*/
export class BaseError extends Error {
/**
* @internal
*/
/** @internal **/
_nativeError: Error;
constructor(message: string) {
// Errors don't use current this, instead they create a new instance.
// We have to do forward all of our api to the nativeInstance.
var nativeError = super(message) as any as Error;
const nativeError = super(message) as any as Error;
this._nativeError = nativeError;
}
@ -40,11 +38,6 @@ export class BaseError extends Error {
export class WrappedError extends BaseError {
originalError: any;
/**
* @internal
*/
_nativeError: Error;
constructor(message: string, error: any) {
super(`${message} caused by: ${error instanceof Error ? error.message: error }`);
this.originalError = error;