diff --git a/TimeMachineStatus.xcodeproj/project.pbxproj b/TimeMachineStatus.xcodeproj/project.pbxproj index 27a3732..0ac45f2 100644 --- a/TimeMachineStatus.xcodeproj/project.pbxproj +++ b/TimeMachineStatus.xcodeproj/project.pbxproj @@ -525,8 +525,8 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatusHelper/TimeMachineStatusHelper.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 4; ENABLE_HARDENED_RUNTIME = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; @@ -538,7 +538,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.3; + MARKETING_VERSION = 0.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatusHelper; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -554,8 +554,8 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatusHelper/TimeMachineStatusHelper.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = ""; + CURRENT_PROJECT_VERSION = 4; ENABLE_HARDENED_RUNTIME = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; @@ -567,7 +567,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.3; + MARKETING_VERSION = 0.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatusHelper; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -702,7 +702,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatus/TimeMachineStatus.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_ASSET_PATHS = "\"TimeMachineStatus/Preview Content\""; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -719,7 +719,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.3; + MARKETING_VERSION = 0.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatus; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -736,7 +736,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatus/TimeMachineStatus.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_ASSET_PATHS = "\"TimeMachineStatus/Preview Content\""; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -753,7 +753,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.3; + MARKETING_VERSION = 0.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatus; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/TimeMachineStatus/Error/UserfacingError.swift b/TimeMachineStatus/Error/UserfacingError.swift index 10a0dff..cd62cab 100644 --- a/TimeMachineStatus/Error/UserfacingError.swift +++ b/TimeMachineStatus/Error/UserfacingError.swift @@ -13,11 +13,14 @@ import SwiftUI enum UserfacingError: Error { case fullDiskPermissionDenied + case debugError(error: Error) var title: LocalizedStringKey { switch self { case .fullDiskPermissionDenied: return "error_fulldiskpermissiondenied_title" + case .debugError: + return "error_debug_title" } } @@ -25,6 +28,8 @@ enum UserfacingError: Error { switch self { case .fullDiskPermissionDenied: return "error_fulldiskpermissiondenied_description" + case .debugError(let error): + return "error_debug_description\(error.localizedDescription)" } } @@ -35,6 +40,7 @@ enum UserfacingError: Error { title: "button_opensystemsettings", url: Constants.URLs.settingsFullDiskAccess ) + default: nil } } diff --git a/TimeMachineStatus/Localizable.xcstrings b/TimeMachineStatus/Localizable.xcstrings index 256b3b5..79caeeb 100644 --- a/TimeMachineStatus/Localizable.xcstrings +++ b/TimeMachineStatus/Localizable.xcstrings @@ -348,6 +348,38 @@ } } }, + "error_debug_description%@" : { + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Error Description: %@" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Error Description: %@" + } + } + } + }, + "error_debug_title" : { + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unknown Error" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unknown Error" + } + } + } + }, "error_fulldiskpermissiondenied_description" : { "extractionState" : "manual", "localizations" : { diff --git a/TimeMachineStatus/ViewModel/TMUtility.swift b/TimeMachineStatus/ViewModel/TMUtility.swift index 198191d..362837a 100644 --- a/TimeMachineStatus/ViewModel/TMUtility.swift +++ b/TimeMachineStatus/ViewModel/TMUtility.swift @@ -47,6 +47,7 @@ class TMUtility: ObservableObject { start(force: status is BackupState.None) } catch { log.error("Error updating status: \(error)") + self.error = UserfacingError.debugError(error: error) start(force: true) } } @@ -63,6 +64,8 @@ class TMUtility: ObservableObject { log.error("Error reading preferences: \(error)") if (error as NSError).code == 257 { self.error = UserfacingError.fullDiskPermissionDenied + } else { + self.error = UserfacingError.debugError(error: error) } } }