From 5f7a0a08b21e3893191818ba2d8d4f42ee86d89c Mon Sep 17 00:00:00 2001 From: OnlyWick Date: Tue, 13 Feb 2024 17:15:18 +0800 Subject: [PATCH] chore(errorHandling): directly return value in callWithErrorHandling function (#10315) --- packages/runtime-core/src/errorHandling.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index a1ed69cc3..041eb1239 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -66,13 +66,11 @@ export function callWithErrorHandling( type: ErrorTypes, args?: unknown[], ) { - let res try { - res = args ? fn(...args) : fn() + return args ? fn(...args) : fn() } catch (err) { handleError(err, instance, type) } - return res } export function callWithAsyncErrorHandling(