Skip to content

Commit

Permalink
Override error's localized message
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Jul 17, 2024
1 parent b36c3a0 commit 322fd02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Networking/Networking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ public enum NetworkingError: Error {
case clientError(statusCode: Int, message: String)
case serverError(statusCode: Int, message: String, details: [String: Any]?)
case unexpectedError(statusCode: Int?, message: String)
}

public var message: String {
extension NetworkingError: LocalizedError {
public var errorDescription: String? {
switch self {
case .invalidURL:
return "We're sorry, but the URL for this request is invalid."
Expand Down

0 comments on commit 322fd02

Please sign in to comment.