This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user