GiteaPR: native iOS app to manage Gitea pull requests
Build iOS App / Build .ipa and publish source (push) Failing after 35s
Build iOS App / Build .ipa and publish source (push) Failing after 35s
Multi-repo PR inbox, review (approve/request changes/comment), merge with gating toggle, read-only diff viewer, and Gitea Actions check status with one-tap re-run. Ships unsigned via the iMac runner to the SideStore source.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import Foundation
|
||||
|
||||
enum APIError: LocalizedError, Equatable {
|
||||
case invalidURL
|
||||
case invalidResponse
|
||||
case httpStatus(Int, String?)
|
||||
case decoding(String)
|
||||
case unauthorized
|
||||
case notFound
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .invalidURL:
|
||||
return "The instance URL is invalid."
|
||||
case .invalidResponse:
|
||||
return "The server returned an invalid response."
|
||||
case .httpStatus(let code, let message):
|
||||
if code == 401 || code == 403 {
|
||||
return "Authentication failed. Check your token."
|
||||
}
|
||||
return message?.isEmpty == false
|
||||
? "Server error (\(code)): \(message!)"
|
||||
: "Server error (\(code))."
|
||||
case .decoding(let detail):
|
||||
return "Could not parse the server response: \(detail)"
|
||||
case .unauthorized:
|
||||
return "Authentication failed. Check your token."
|
||||
case .notFound:
|
||||
return "Not found."
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user