fix(short-drama-agent-front): 修复代码格式检查问题
This commit is contained in:
1 parent
81d6a85260
commit
48fce3975f
87 files changed
+5714
-1436
No files matched your search
+10
-2
@@ -102,9 +102,17 @@ export async function optionalResource<T>(promise: Promise<T>): Promise<T | null
|
||||
export function errorMessage(error: unknown): string {
|
||||
const fallback = '操作失败,请刷新后重试。'
|
||||
if (error instanceof ApiError) {
|
||||
const configurationMessage = configurationErrorText(error.code) ?? configurationErrorText(isRecord(error.details) ? error.details.code : undefined)
|
||||
const configurationMessage =
|
||||
configurationErrorText(error.code) ??
|
||||
configurationErrorText(isRecord(error.details) ? error.details.code : undefined)
|
||||
if (configurationMessage) return configurationMessage
|
||||
return [...new Set([userFacingText(error.message, fallback), ...businessErrorMessages(error.details)].filter(Boolean))].join(';') || fallback
|
||||
return (
|
||||
[
|
||||
...new Set(
|
||||
[userFacingText(error.message, fallback), ...businessErrorMessages(error.details)].filter(Boolean)
|
||||
)
|
||||
].join(';') || fallback
|
||||
)
|
||||
}
|
||||
return error instanceof Error ? userFacingText(error.message, fallback) || fallback : fallback
|
||||
}
|
||||
Reference in new issue
Block a user