2017-04-30 16:16:52 -05:00
|
|
|
//
|
|
|
|
|
// AppError.swift
|
|
|
|
|
// pass
|
|
|
|
|
//
|
|
|
|
|
// Created by Mingshen Sun on 30/4/2017.
|
|
|
|
|
// Copyright © 2017 Bob Sun. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
2017-06-14 00:25:38 +08:00
|
|
|
public enum AppError: Error {
|
2017-04-30 16:16:52 -05:00
|
|
|
case RepositoryNotSetError
|
2019-01-06 20:10:47 +01:00
|
|
|
case RepositoryRemoteBranchNotFoundError(_: String)
|
|
|
|
|
case RepositoryBranchNotFound(_: String)
|
2017-04-30 16:16:52 -05:00
|
|
|
case KeyImportError
|
|
|
|
|
case PasswordDuplicatedError
|
|
|
|
|
case GitResetError
|
2017-04-30 18:29:47 -05:00
|
|
|
case PGPPublicKeyNotExistError
|
2017-10-15 21:37:00 +08:00
|
|
|
case WrongPasswordFilename
|
2018-11-10 22:38:12 -08:00
|
|
|
case DecryptionError
|
2017-04-30 16:16:52 -05:00
|
|
|
case UnknownError
|
2017-05-11 22:55:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension AppError: LocalizedError {
|
|
|
|
|
public var errorDescription: String? {
|
2019-01-14 20:57:45 +01:00
|
|
|
return String(describing: self).localize()
|
2017-04-30 16:16:52 -05:00
|
|
|
}
|
|
|
|
|
}
|