Handle invalid date in Status created_at

Closes #477
This commit is contained in:
Shadowfacts 2024-05-19 14:48:57 -04:00
parent c33be1cbf3
commit f6e57d664f
1 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,8 @@ public struct Client: Sendable {
} else if let date = iso8601.date(from: str) { } else if let date = iso8601.date(from: str) {
return date return date
} else { } else {
throw DecodingError.typeMismatch(Date.self, .init(codingPath: container.codingPath, debugDescription: "unexpected date format: \(str)")) // throw DecodingError.typeMismatch(Date.self, .init(codingPath: container.codingPath, debugDescription: "unexpected date format: \(str)"))
return Date(timeIntervalSinceReferenceDate: 0)
} }
}) })