Add album detail and track listing

This commit is contained in:
lucast committed 2026-10-07 01:40:54 +02:00
1 parent c415380336
commit 39a64bebf2
4 files changed
+355 -11

No files matched your search

+9 -4
View File
@@ -79,9 +79,14 @@ public final class APIClient: @unchecked Sendable {
body: Body? = nil,
response: Response.Type = Response.self
) async throws -> Response {
try await perform(
method, path: path, query: query, body: body, response: response,
refreshAfterUnauthorized: true)
do {
return try await perform(
method, path: path, query: query, body: body, response: response,
refreshAfterUnauthorized: true)
} catch {
print("[APIClient] \(method) \(path) failed: \(error.localizedDescription)")
throw error
}
}
private func perform<Response: Decodable & Sendable, Body: Encodable & Sendable>(
@@ -156,7 +161,7 @@ public final class APIClient: @unchecked Sendable {
return try decoder.decode(Response.self, from: Data("null".utf8))
}
return try decoder.decode(Response.self, from: data)
} catch { throw APIError.decoding(error.localizedDescription) }
} catch { throw APIError.decoding(String(describing: error)) }
} catch let error as APIError { throw error } catch {
throw APIError.transport(error.localizedDescription)
}