Skip to content

Commit

Permalink
chore(errorHandling): directly return value in callWithErrorHandling …
Browse files Browse the repository at this point in the history
…function (#10315)
  • Loading branch information
OnlyWick committed Feb 13, 2024
1 parent b8be990 commit 5f7a0a0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/runtime-core/src/errorHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5f7a0a0

Please sign in to comment.