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:
@@ -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 {}
|
||||
|
||||
@@ -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)"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user