refactor(common): cleanup (#11668)
This commit is contained in:

committed by
Rado Kirov

parent
3a6fcee0e6
commit
0ca971c5bd
@ -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;
|
||||
|
Reference in New Issue
Block a user