Subclassing errors is problematic since Error returns a
new instance. All of the patching which we do than prevent
proper application of source maps.
PR Close#14160
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;