mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Create CommonErrors module.
This commit is contained in:
29
ReaderAPI/Sources/ReaderAPI/ReaderAPIError.swift
Normal file
29
ReaderAPI/Sources/ReaderAPI/ReaderAPIError.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// ReaderAPIError.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 4/6/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum ReaderAPIError: LocalizedError {
|
||||
|
||||
case unknown
|
||||
case invalidParameter
|
||||
case invalidResponse
|
||||
case urlNotFound
|
||||
|
||||
public var errorDescription: String? {
|
||||
switch self {
|
||||
case .unknown:
|
||||
return NSLocalizedString("An unexpected error occurred.", comment: "An unexpected error occurred.")
|
||||
case .invalidParameter:
|
||||
return NSLocalizedString("An invalid parameter was passed.", comment: "An invalid parameter was passed.")
|
||||
case .invalidResponse:
|
||||
return NSLocalizedString("There was an invalid response from the server.", comment: "There was an invalid response from the server.")
|
||||
case .urlNotFound:
|
||||
return NSLocalizedString("The API URL wasn't found.", comment: "The API URL wasn't found.")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user