fix: 优化 VOD API 错误提示,显示具体错误信息
CI / lint-and-build (push) Has been cancelled

This commit is contained in:
2026-06-30 08:51:24 +06:00
parent 04fadb4f8f
commit 1c8a329de3
@@ -1,10 +1,23 @@
import Foundation import Foundation
enum VODClientError: Error { enum VODClientError: Error, LocalizedError {
case noActiveAccount case noActiveAccount
case invalidResponse case invalidResponse
case apiError(String) case apiError(String)
case networkError(Error) 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 { actor VODClient {