feat(dongchedi): translate platform "server exception" into actionable copy
Map dongchedi adapter failures (raw "server exception" or dongchedi_platform_exception) to a Chinese prompt steering the user to the dongchedi backend, so renderer/admin views and desktop-task error payloads no longer surface the opaque platform message.
This commit is contained in:
@@ -196,7 +196,7 @@ function normalizePublishTaskStatus(status: DesktopTaskInfo['status']): DesktopT
|
||||
return status === 'unknown' ? 'failed' : status
|
||||
}
|
||||
|
||||
function normalizeTaskErrorMessage(message: string | null): string | null {
|
||||
function normalizeTaskErrorMessage(message: string | null, platform?: string | null): string | null {
|
||||
const normalized = extractString(message)
|
||||
if (!normalized) {
|
||||
return null
|
||||
@@ -207,7 +207,7 @@ function normalizeTaskErrorMessage(message: string | null): string | null {
|
||||
if (normalized.includes('adapter is not implemented for this platform')) {
|
||||
return '当前平台的桌面发布适配器未实现,任务已按失败处理。'
|
||||
}
|
||||
return normalizePublisherErrorMessage(normalized) ?? normalized
|
||||
return normalizePublisherErrorMessage(normalized, platform) ?? normalized
|
||||
}
|
||||
|
||||
function complianceLevelLabel(level: string | null): string {
|
||||
@@ -607,6 +607,7 @@ const publishTasks = computed<PublishTaskItem[]>(() =>
|
||||
extractString(taskError.message) ??
|
||||
extractString(taskError.detail) ??
|
||||
extractString(taskError.code),
|
||||
task.platform,
|
||||
),
|
||||
complianceBlockedRecordId,
|
||||
complianceBlockedAt: task.compliance_blocked_at ? parseTimestamp(task.compliance_blocked_at) : null,
|
||||
|
||||
Reference in New Issue
Block a user