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
commit 1f87676d52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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')]
}
}