Supports display license status (#10408)

Co-authored-by: Garfield Dai <dai.hai@foxmail.com>
This commit is contained in:
NFish
2024-11-15 17:59:48 +08:00
committed by GitHub
parent c2ce2f88c7
commit 1f87676d52
11 changed files with 187 additions and 53 deletions

View File

@@ -8,10 +8,8 @@ export async function asyncRunSafe<T = any>(fn: Promise<T>): Promise<[Error] | [
try {
return [null, await fn]
}
catch (e) {
if (e instanceof Error)
return [e]
return [new Error('unknown error')]
catch (e: any) {
return [e || new Error('unknown error')]
}
}