chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:22:33 +08:00
commit fc4fcbab58
1848 changed files with 472303 additions and 0 deletions
@@ -0,0 +1,27 @@
import Foundation
public enum PerplexityAPIError: LocalizedError, Sendable, Equatable {
case missingToken
case invalidCookie
case invalidToken
case networkError(String)
case apiError(String)
case parseFailed(String)
public var errorDescription: String? {
switch self {
case .missingToken:
"Perplexity session token is missing. Please log into Perplexity in your browser."
case .invalidCookie:
"Perplexity manual cookie header is empty or invalid."
case .invalidToken:
"Perplexity session token is invalid or expired. Please log in again."
case let .networkError(message):
"Perplexity network error: \(message)"
case let .apiError(message):
"Perplexity API error: \(message)"
case let .parseFailed(message):
"Failed to parse Perplexity usage data: \(message)"
}
}
}