Add in-app diagnostic logging + resilient inbox; bump to 1.2
Build iOS App / Build .ipa and publish source (push) Failing after 5m44s
Build iOS App / Build .ipa and publish source (push) Failing after 5m44s
- LogStore: bounded in-memory + persisted log of API calls and errors, viewable and shareable from Settings → View logs. - GiteaClient: log every request/response status (esp. 404s). - Inbox: a single failing repo no longer wipes the whole inbox — per-repo errors are caught, logged, and the rest still load. - Bump to 1.2 so SideStore offers the update.
This commit is contained in:
1 parent
43f4d76356
commit
b51b2ee5c8
6 files changed
+202
-11
No files matched your search
@@ -78,18 +78,23 @@ struct GiteaClient {
|
||||
|
||||
let (data, response) = try await session.data(for: req)
|
||||
guard let http = response as? HTTPURLResponse else {
|
||||
LogStore.shared.log(.error, "\(method) \(path) → invalid response")
|
||||
throw APIError.invalidResponse
|
||||
}
|
||||
switch http.statusCode {
|
||||
case 200...299:
|
||||
LogStore.shared.log(.info, "\(method) \(path) → \(http.statusCode)")
|
||||
return data
|
||||
case 401, 403:
|
||||
LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) unauthorized")
|
||||
throw APIError.unauthorized
|
||||
case 404:
|
||||
LogStore.shared.log(.error, "\(method) \(path) → 404 not found")
|
||||
throw APIError.notFound
|
||||
default:
|
||||
let message = (try? Self.decoder.decode([String: String].self,
|
||||
from: data))?["message"]
|
||||
LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) \(message ?? "")")
|
||||
throw APIError.httpStatus(http.statusCode, message)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user