Improve rate limit exceeded error message

This commit is contained in:
Shadowfacts 2023-05-10 10:59:22 -04:00
parent bac272a2db
commit f13874ee01
2 changed files with 4 additions and 0 deletions

View File

@ -508,6 +508,8 @@ extension Client {
// todo: support more status codes
case .unexpectedStatus(413):
return "HTTP 413: Payload Too Large"
case .unexpectedStatus(429):
return "HTTP 429: Rate Limit Exceeded"
case .unexpectedStatus(let code):
return "HTTP Code \(code)"
case .invalidRequest:

View File

@ -85,6 +85,8 @@ fileprivate extension Pachyderm.Client.Error {
switch type {
case .networkError(_):
return "wifi.exclamationmark"
case .unexpectedStatus(429):
return "clock.badge.exclamationmark"
default:
return "exclamationmark.triangle"
}