Vernissage/Vernissage/Errors/AuthorisationError.swift

24 lines
694 B
Swift
Raw Normal View History

2023-01-29 19:11:44 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
2023-03-28 10:35:38 +02:00
// Licensed under the Apache License 2.0.
2023-01-29 19:11:44 +01:00
//
import Foundation
public enum AuthorisationError: Error {
case badServerUrl
2023-02-03 15:16:30 +01:00
case accessTokenNotFound
2023-01-29 19:11:44 +01:00
}
extension AuthorisationError: LocalizedError {
public var errorDescription: String? {
switch self {
case .badServerUrl:
2023-03-15 14:27:59 +01:00
return NSLocalizedString("global.error.badUrlServer", comment: "User enter bad URL to server.")
2023-02-03 15:16:30 +01:00
case .accessTokenNotFound:
2023-03-15 14:27:59 +01:00
return NSLocalizedString("global.error.accessTokenNotFound", comment: "Access token is not saved in account model.")
2023-01-29 19:11:44 +01:00
}
}
}