From 1c8a329de30edf573be47110553ffdc7bfa3d6b6 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 30 Jun 2026 08:51:24 +0600 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=20VOD=20API=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/VODManager/Services/VODClient.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/macos/VODManager/Sources/VODManager/Services/VODClient.swift b/apps/macos/VODManager/Sources/VODManager/Services/VODClient.swift index 0c2a64c..42ca901 100644 --- a/apps/macos/VODManager/Sources/VODManager/Services/VODClient.swift +++ b/apps/macos/VODManager/Sources/VODManager/Services/VODClient.swift @@ -1,10 +1,23 @@ import Foundation -enum VODClientError: Error { +enum VODClientError: Error, LocalizedError { case noActiveAccount case invalidResponse case apiError(String) case networkError(Error) + + var errorDescription: String? { + switch self { + case .noActiveAccount: + return "没有激活的阿里云账号,请先在「账号配置」中添加并切换账号" + case .invalidResponse: + return "无法解析服务器响应" + case .apiError(let message): + return "阿里云 API 错误:\(message)" + case .networkError(let underlying): + return "网络错误:\(underlying.localizedDescription)" + } + } } actor VODClient {