Skip to content

Commit 5f7a0a0

Browse files
authored
chore(errorHandling): directly return value in callWithErrorHandling function (#10315)
1 parent b8be990 commit 5f7a0a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/runtime-core/src/errorHandling.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ export function callWithErrorHandling(
6666
type: ErrorTypes,
6767
args?: unknown[],
6868
) {
69-
let res
7069
try {
71-
res = args ? fn(...args) : fn()
70+
return args ? fn(...args) : fn()
7271
} catch (err) {
7372
handleError(err, instance, type)
7473
}
75-
return res
7674
}
7775

7876
export function callWithAsyncErrorHandling(

0 commit comments

Comments
 (0)