@@ -24,6 +24,9 @@ public enum WeatherError : LocalizedError, Equatable, Hashable {
2424
2525 case missingData( _ attributeName: String )
2626
27+ /// An invalid request parameter.
28+ case invalidRequest( _ message: String )
29+
2730 /// A localized message describing what error occurred.
2831 public var errorDescription : String ? {
2932 switch self {
@@ -36,6 +39,8 @@ public enum WeatherError : LocalizedError, Equatable, Hashable {
3639 return NSLocalizedString ( " Error.timezone " , bundle: Bundle . module, comment: " Could not determine timezone " )
3740 case let . missingData( name) :
3841 return String ( format: NSLocalizedString ( " Error.missingData " , bundle: Bundle . module, comment: " The data \( name) is missing from the response " ) , name)
42+ case let . invalidRequest( message) :
43+ return message
3944 }
4045 }
4146
@@ -51,6 +56,8 @@ public enum WeatherError : LocalizedError, Equatable, Hashable {
5156 return NSLocalizedString ( " Error.timezone " , bundle: Bundle . module, comment: " Could not determine timezone " )
5257 case let . missingData( name) :
5358 return String ( format: NSLocalizedString ( " Error.missingData " , bundle: Bundle . module, comment: " The data \( name) is missing from the response " ) , name)
59+ case let . invalidRequest( message) :
60+ return message
5461 }
5562 }
5663
0 commit comments