1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-08 05:30:05 +01:00

🚛 Reorganise Errors structs

This commit is contained in:
2022-02-08 21:26:06 +01:00
parent f5af33c098
commit ffb112cfb2
3 changed files with 22 additions and 31 deletions

View File

@@ -8,4 +8,22 @@
import Foundation
// MARK: - Alertable Errors
// These errors must be resolved by the user.
struct HomebrewPermissionError: Error, AlertableError {
enum Kind: String {
case applescriptNilError = "homebrew_permissions.applescript_returned_nil"
}
let kind: Kind
func getErrorMessageKey() -> String {
return "alert.errors.\(self.kind.rawValue)"
}
}
// MARK: - Errors that do not have an associated alert message
// The errors must be resolved by the developer.
struct VersionParseError: Error {}

View File

@@ -1,21 +0,0 @@
//
// HomebrewPermissionError.swift
// PHP Monitor
//
// Created by Nico Verbruggen on 06/02/2022.
// Copyright © 2022 Nico Verbruggen. All rights reserved.
//
import Foundation
struct HomebrewPermissionError: Error, AlertableError {
enum Kind: String {
case applescriptNilError = "homebrew_permissions.applescript_returned_nil"
}
let kind: Kind
func getErrorMessageKey() -> String {
return "alert.errors.\(self.kind.rawValue)"
}
}