chore(errorHandling): directly return value in callWithErrorHandling function (#10315)

This commit is contained in:
OnlyWick 2024-02-13 17:15:18 +08:00 committed by GitHub
parent b8be99018c
commit 5f7a0a08b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -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(