diff --git a/Packages/Pachyderm/Sources/Pachyderm/Model/Status.swift b/Packages/Pachyderm/Sources/Pachyderm/Model/Status.swift index 133a5d47..a5ff6f37 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Model/Status.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Model/Status.swift @@ -48,7 +48,12 @@ public final class Status: StatusProtocol, Decodable, Sendable { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decode(String.self, forKey: .id) self.uri = try container.decode(String.self, forKey: .uri) - self.url = try container.decodeIfPresent(WebURL.self, forKey: .url) + do { + self.url = try container.decodeIfPresent(WebURL.self, forKey: .url) + } catch { + let s = (try? container.decode(String.self, forKey: .url)) ?? "" + throw DecodingError.dataCorruptedError(forKey: .url, in: container, debugDescription: "Could not decode URL '\(s)', reason: \(String(describing: error))") + } self.account = try container.decode(Account.self, forKey: .account) self.inReplyToID = try container.decodeIfPresent(String.self, forKey: .inReplyToID) self.inReplyToAccountID = try container.decodeIfPresent(String.self, forKey: .inReplyToAccountID)