refactor(core): optimize the implementation about finding context from error in ErrorHandler (#42581)
in _findContext method, use conditional operator check whether the params 'error' exists and then us reccursion way to find context in original error if getDebugContext's result does not exist. PR Close #42581
This commit is contained in:
parent
1067be7ab8
commit
e8be045cbd
|
@ -59,7 +59,7 @@ export class ErrorHandler {
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
_findContext(error: any): any {
|
_findContext(error: any): any {
|
||||||
return !error ? null : getDebugContext(error) ?? this._findContext(getOriginalError(error));
|
return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
|
|
Loading…
Reference in New Issue