Report string when mention url decoding fails
This commit is contained in:
parent
9c3be68e1c
commit
b28792eb29
|
@ -21,7 +21,12 @@ public struct Mention: Codable, Sendable {
|
|||
self.username = try container.decode(String.self, forKey: .username)
|
||||
self.acct = try container.decode(String.self, forKey: .acct)
|
||||
self.id = try container.decode(String.self, forKey: .id)
|
||||
do {
|
||||
self.url = try container.decode(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 ?? "<failed to decode string>")'")
|
||||
}
|
||||
}
|
||||
|
||||
public init(url: WebURL, username: String, acct: String, id: String) {
|
||||
|
|
Loading…
Reference in New Issue