From a5e9846c06c27e6921395bbf0db2a9f8c0966d5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:08:13 +0000 Subject: [PATCH 1/3] Initial plan From 8073493f483d0c2a0e4f11a7a11948f3e074a097 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:11:32 +0000 Subject: [PATCH 2/3] Replace all instances of DriverUpdate with Drivelution Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com> --- doc/GeneralUpdate.Drivelution.md | 22 +++++----- .../Core/DriverUpdaterFactoryTests.cs | 40 +++++++++---------- .../GeneralDrivelutionTests.cs | 4 +- .../Configuration/DriverUpdateOptions.cs | 4 +- .../Exceptions/DriverUpdateExceptions.cs | 18 ++++----- .../Core/DriverUpdaterFactory.cs | 6 +-- .../Core/Logging/LoggerConfigurator.cs | 6 +-- .../GeneralDrivelution.cs | 14 +++---- .../WindowsGeneralDrivelution.cs | 2 +- 9 files changed, 58 insertions(+), 58 deletions(-) diff --git a/doc/GeneralUpdate.Drivelution.md b/doc/GeneralUpdate.Drivelution.md index 6dabb064..7952a7e0 100644 --- a/doc/GeneralUpdate.Drivelution.md +++ b/doc/GeneralUpdate.Drivelution.md @@ -73,10 +73,10 @@ using GeneralUpdate.Drivelution.Abstractions.Configuration; using GeneralUpdate.Drivelution.Abstractions.Models; // Configure options -var options = new DriverUpdateOptions +var options = new DrivelutionOptions { LogLevel = "Debug", - LogFilePath = "./Logs/driver-update-.log", + LogFilePath = "./Logs/drivelution-.log", EnableConsoleLogging = true, EnableFileLogging = true, DefaultBackupPath = "./Backups", @@ -272,7 +272,7 @@ var driverInfo = new DriverInfo #### GPG Signature Validation ```csharp // Linux drivers can be validated using GPG signatures -var options = new DriverUpdateOptions +var options = new DrivelutionOptions { TrustedGpgKeys = new List { @@ -531,10 +531,10 @@ var updater = GeneralDrivelution.Create(); ### Custom Logging Configuration ```csharp -var options = new DriverUpdateOptions +var options = new DrivelutionOptions { LogLevel = "Debug", // Verbose logging - LogFilePath = "./Logs/driver-update-.log", // Rolling file logs + LogFilePath = "./Logs/drivelution-.log", // Rolling file logs EnableConsoleLogging = true, // Console output EnableFileLogging = true // File output }; @@ -707,7 +707,7 @@ catch (OperationCanceledException) ### 5. Log Everything ```csharp -var options = new DriverUpdateOptions +var options = new DrivelutionOptions { LogLevel = "Info", // Use Info level in production EnableFileLogging = true, // Keep file logs for auditing @@ -718,7 +718,7 @@ var options = new DriverUpdateOptions ### 6. Clean Up Old Backups ```csharp -var options = new DriverUpdateOptions +var options = new DrivelutionOptions { AutoCleanupBackups = true, // Enable automatic cleanup BackupsToKeep = 5 // Keep last 5 backups @@ -751,7 +751,7 @@ var strategy = new UpdateStrategy ```csharp public async Task PerformSilentUpdateAsync(DriverInfo driverInfo) { - var options = new DriverUpdateOptions + var options = new DrivelutionOptions { EnableConsoleLogging = false, // No console output EnableFileLogging = true, // Log to file @@ -919,7 +919,7 @@ sudo ./YourApp **Solution**: ```csharp // Enable detailed logging to identify the specific validation failure -var options = new DriverUpdateOptions { LogLevel = "Debug" }; +var options = new DrivelutionOptions { LogLevel = "Debug" }; var updater = GeneralDrivelution.Create(options); // Try validation separately @@ -1060,10 +1060,10 @@ var strategy = new UpdateStrategy ```csharp // Create updater with default options -IGeneralDrivelution Create(DriverUpdateOptions? options = null) +IGeneralDrivelution Create(DrivelutionOptions? options = null) // Create updater with custom logger -IGeneralDrivelution Create(ILogger logger, DriverUpdateOptions? options = null) +IGeneralDrivelution Create(ILogger logger, DrivelutionOptions? options = null) // Quick update with default settings Task QuickUpdateAsync(DriverInfo driverInfo, CancellationToken cancellationToken = default) diff --git a/src/c#/DrivelutionTest/Core/DriverUpdaterFactoryTests.cs b/src/c#/DrivelutionTest/Core/DriverUpdaterFactoryTests.cs index 75feab57..eecd821c 100644 --- a/src/c#/DrivelutionTest/Core/DriverUpdaterFactoryTests.cs +++ b/src/c#/DrivelutionTest/Core/DriverUpdaterFactoryTests.cs @@ -7,10 +7,10 @@ namespace DrivelutionTest.Core; /// -/// Tests for DriverUpdaterFactory class. +/// Tests for DrivelutionFactory class. /// Validates platform detection, factory creation, and platform-specific implementations. /// -public class DriverUpdaterFactoryTests +public class DrivelutionFactoryTests { /// /// Tests that Create method returns a non-null instance. @@ -19,7 +19,7 @@ public class DriverUpdaterFactoryTests public void Create_WithoutParameters_ReturnsNonNullInstance() { // Arrange & Act - var updater = DriverUpdaterFactory.Create(); + var updater = DrivelutionFactory.Create(); // Assert Assert.NotNull(updater); @@ -39,7 +39,7 @@ public void Create_WithCustomLogger_ReturnsInstance() .CreateLogger(); // Act - var updater = DriverUpdaterFactory.Create(logger); + var updater = DrivelutionFactory.Create(logger); // Assert Assert.NotNull(updater); @@ -53,14 +53,14 @@ public void Create_WithCustomLogger_ReturnsInstance() public void Create_WithCustomOptions_ReturnsInstance() { // Arrange - var options = new DriverUpdateOptions + var options = new DrivelutionOptions { LogLevel = "Debug", LogFilePath = "./logs/test.log" }; // Act - var updater = DriverUpdaterFactory.Create(null, options); + var updater = DrivelutionFactory.Create(null, options); // Assert Assert.NotNull(updater); @@ -73,7 +73,7 @@ public void Create_WithCustomOptions_ReturnsInstance() public void GetCurrentPlatform_ReturnsValidPlatformName() { // Act - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); // Assert Assert.NotNull(platform); @@ -87,11 +87,11 @@ public void GetCurrentPlatform_ReturnsValidPlatformName() public void IsPlatformSupported_ReturnsBooleanValue() { // Act - var isSupported = DriverUpdaterFactory.IsPlatformSupported(); + var isSupported = DrivelutionFactory.IsPlatformSupported(); // Assert // Windows and Linux should be supported - Assert.True(isSupported || DriverUpdaterFactory.GetCurrentPlatform() == "MacOS" || DriverUpdaterFactory.GetCurrentPlatform() == "Unknown"); + Assert.True(isSupported || DrivelutionFactory.GetCurrentPlatform() == "MacOS" || DrivelutionFactory.GetCurrentPlatform() == "Unknown"); } /// @@ -101,14 +101,14 @@ public void IsPlatformSupported_ReturnsBooleanValue() public void CreateValidator_WithoutLogger_ReturnsNonNullInstance() { // Skip on MacOS and Unknown platforms - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); if (platform == "MacOS" || platform == "Unknown") { return; } // Act - var validator = DriverUpdaterFactory.CreateValidator(); + var validator = DrivelutionFactory.CreateValidator(); // Assert Assert.NotNull(validator); @@ -122,14 +122,14 @@ public void CreateValidator_WithoutLogger_ReturnsNonNullInstance() public void CreateBackup_WithoutLogger_ReturnsNonNullInstance() { // Skip on MacOS and Unknown platforms - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); if (platform == "MacOS" || platform == "Unknown") { return; } // Act - var backup = DriverUpdaterFactory.CreateBackup(); + var backup = DrivelutionFactory.CreateBackup(); // Assert Assert.NotNull(backup); @@ -143,7 +143,7 @@ public void CreateBackup_WithoutLogger_ReturnsNonNullInstance() public void CreateValidator_WithCustomLogger_ReturnsInstance() { // Skip on MacOS and Unknown platforms - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); if (platform == "MacOS" || platform == "Unknown") { return; @@ -156,7 +156,7 @@ public void CreateValidator_WithCustomLogger_ReturnsInstance() .CreateLogger(); // Act - var validator = DriverUpdaterFactory.CreateValidator(logger); + var validator = DrivelutionFactory.CreateValidator(logger); // Assert Assert.NotNull(validator); @@ -169,7 +169,7 @@ public void CreateValidator_WithCustomLogger_ReturnsInstance() public void CreateBackup_WithCustomLogger_ReturnsInstance() { // Skip on MacOS and Unknown platforms - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); if (platform == "MacOS" || platform == "Unknown") { return; @@ -182,7 +182,7 @@ public void CreateBackup_WithCustomLogger_ReturnsInstance() .CreateLogger(); // Act - var backup = DriverUpdaterFactory.CreateBackup(logger); + var backup = DrivelutionFactory.CreateBackup(logger); // Assert Assert.NotNull(backup); @@ -196,17 +196,17 @@ public void CreateBackup_WithCustomLogger_ReturnsInstance() public void Create_OnSupportedPlatform_DoesNotThrow() { // Skip on MacOS as it's not yet implemented - var platform = DriverUpdaterFactory.GetCurrentPlatform(); + var platform = DrivelutionFactory.GetCurrentPlatform(); if (platform == "MacOS") { // MacOS should throw PlatformNotSupportedException - Assert.Throws(() => DriverUpdaterFactory.Create()); + Assert.Throws(() => DrivelutionFactory.Create()); return; } // Act & Assert - should not throw on Windows/Linux - var exception = Record.Exception(() => DriverUpdaterFactory.Create()); + var exception = Record.Exception(() => DrivelutionFactory.Create()); Assert.Null(exception); } } diff --git a/src/c#/DrivelutionTest/GeneralDrivelutionTests.cs b/src/c#/DrivelutionTest/GeneralDrivelutionTests.cs index c7460e4f..cd22a06d 100644 --- a/src/c#/DrivelutionTest/GeneralDrivelutionTests.cs +++ b/src/c#/DrivelutionTest/GeneralDrivelutionTests.cs @@ -31,7 +31,7 @@ public void Create_WithoutParameters_ReturnsNonNullInstance() public void Create_WithOptions_ReturnsNonNullInstance() { // Arrange - var options = new DriverUpdateOptions + var options = new DrivelutionOptions { LogLevel = "Information", LogFilePath = "./logs/test.log" @@ -74,7 +74,7 @@ public void Create_WithCustomLoggerAndOptions_ReturnsInstance() .MinimumLevel.Debug() .WriteTo.Console() .CreateLogger(); - var options = new DriverUpdateOptions + var options = new DrivelutionOptions { LogLevel = "Debug" }; diff --git a/src/c#/GeneralUpdate.Drivelution/Abstractions/Configuration/DriverUpdateOptions.cs b/src/c#/GeneralUpdate.Drivelution/Abstractions/Configuration/DriverUpdateOptions.cs index 0258ec1d..b450a267 100644 --- a/src/c#/GeneralUpdate.Drivelution/Abstractions/Configuration/DriverUpdateOptions.cs +++ b/src/c#/GeneralUpdate.Drivelution/Abstractions/Configuration/DriverUpdateOptions.cs @@ -4,7 +4,7 @@ namespace GeneralUpdate.Drivelution.Abstractions.Configuration; /// 驱动更新配置选项 /// Driver update configuration options /// -public class DriverUpdateOptions +public class DrivelutionOptions { /// /// 默认备份路径 @@ -22,7 +22,7 @@ public class DriverUpdateOptions /// 日志文件路径 /// Log file path /// - public string LogFilePath { get; set; } = "./Logs/driver-update-.log"; + public string LogFilePath { get; set; } = "./Logs/drivelution-.log"; /// /// 是否启用控制台日志 diff --git a/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs b/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs index ee1f76bf..5ace1349 100644 --- a/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs +++ b/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs @@ -4,19 +4,19 @@ namespace GeneralUpdate.Drivelution.Abstractions.Exceptions; /// 驱动更新基础异常 /// Base exception for driver update /// -public class DriverUpdateException : Exception +public class DrivelutionException : Exception { public string ErrorCode { get; set; } public bool CanRetry { get; set; } - public DriverUpdateException(string message, string errorCode = "DU_UNKNOWN", bool canRetry = false) + public DrivelutionException(string message, string errorCode = "DU_UNKNOWN", bool canRetry = false) : base(message) { ErrorCode = errorCode; CanRetry = canRetry; } - public DriverUpdateException(string message, Exception innerException, string errorCode = "DU_UNKNOWN", bool canRetry = false) + public DrivelutionException(string message, Exception innerException, string errorCode = "DU_UNKNOWN", bool canRetry = false) : base(message, innerException) { ErrorCode = errorCode; @@ -28,7 +28,7 @@ public DriverUpdateException(string message, Exception innerException, string er /// 权限异常 /// Permission exception /// -public class DriverPermissionException : DriverUpdateException +public class DriverPermissionException : DrivelutionException { public DriverPermissionException(string message) : base(message, "DU_PERMISSION_DENIED", false) @@ -45,7 +45,7 @@ public DriverPermissionException(string message, Exception innerException) /// 校验失败异常 /// Validation failed exception /// -public class DriverValidationException : DriverUpdateException +public class DriverValidationException : DrivelutionException { public string ValidationType { get; set; } @@ -66,7 +66,7 @@ public DriverValidationException(string message, string validationType, Exceptio /// 安装失败异常 /// Installation failed exception /// -public class DriverInstallationException : DriverUpdateException +public class DriverInstallationException : DrivelutionException { public DriverInstallationException(string message, bool canRetry = true) : base(message, "DU_INSTALLATION_FAILED", canRetry) @@ -83,7 +83,7 @@ public DriverInstallationException(string message, Exception innerException, boo /// 备份失败异常 /// Backup failed exception /// -public class DriverBackupException : DriverUpdateException +public class DriverBackupException : DrivelutionException { public DriverBackupException(string message) : base(message, "DU_BACKUP_FAILED", true) @@ -100,7 +100,7 @@ public DriverBackupException(string message, Exception innerException) /// 回滚失败异常 /// Rollback failed exception /// -public class DriverRollbackException : DriverUpdateException +public class DriverRollbackException : DrivelutionException { public DriverRollbackException(string message) : base(message, "DU_ROLLBACK_FAILED", false) @@ -117,7 +117,7 @@ public DriverRollbackException(string message, Exception innerException) /// 兼容性异常 /// Compatibility exception /// -public class DriverCompatibilityException : DriverUpdateException +public class DriverCompatibilityException : DrivelutionException { public DriverCompatibilityException(string message) : base(message, "DU_COMPATIBILITY_FAILED", false) diff --git a/src/c#/GeneralUpdate.Drivelution/Core/DriverUpdaterFactory.cs b/src/c#/GeneralUpdate.Drivelution/Core/DriverUpdaterFactory.cs index 4794c717..10a2e4af 100644 --- a/src/c#/GeneralUpdate.Drivelution/Core/DriverUpdaterFactory.cs +++ b/src/c#/GeneralUpdate.Drivelution/Core/DriverUpdaterFactory.cs @@ -12,7 +12,7 @@ namespace GeneralUpdate.Drivelution.Core; /// 驱动更新器工厂类 - 自动检测平台并创建相应的实现 /// Driver updater factory - Automatically detects platform and creates appropriate implementation /// -public static class DriverUpdaterFactory +public static class DrivelutionFactory { /// /// 创建适合当前平台的驱动更新器 @@ -22,7 +22,7 @@ public static class DriverUpdaterFactory /// 配置选项(可选)/ Configuration options (optional) /// 平台特定的驱动更新器实现 / Platform-specific driver updater implementation /// 当前平台不支持时抛出 / Thrown when current platform is not supported - public static IGeneralDrivelution Create(ILogger? logger = null, DriverUpdateOptions? options = null) + public static IGeneralDrivelution Create(ILogger? logger = null, DrivelutionOptions? options = null) { // Use default logger if not provided logger ??= CreateDefaultLogger(options); @@ -149,7 +149,7 @@ public static bool IsPlatformSupported() /// 创建默认日志记录器 /// Creates a default logger /// - private static ILogger CreateDefaultLogger(DriverUpdateOptions? options = null) + private static ILogger CreateDefaultLogger(DrivelutionOptions? options = null) { if (options != null) { diff --git a/src/c#/GeneralUpdate.Drivelution/Core/Logging/LoggerConfigurator.cs b/src/c#/GeneralUpdate.Drivelution/Core/Logging/LoggerConfigurator.cs index 9bf76232..5a488595 100644 --- a/src/c#/GeneralUpdate.Drivelution/Core/Logging/LoggerConfigurator.cs +++ b/src/c#/GeneralUpdate.Drivelution/Core/Logging/LoggerConfigurator.cs @@ -16,7 +16,7 @@ public static class LoggerConfigurator /// /// 驱动更新配置选项 / Driver update configuration options /// 配置好的日志器 / Configured logger - public static ILogger ConfigureLogger(DriverUpdateOptions options) + public static ILogger ConfigureLogger(DrivelutionOptions options) { if (options == null) { @@ -40,7 +40,7 @@ public static ILogger ConfigureLogger(DriverUpdateOptions options) if (options.EnableFileLogging) { var logPath = string.IsNullOrWhiteSpace(options.LogFilePath) - ? "./Logs/driver-update-.log" + ? "./Logs/drivelution-.log" : options.LogFilePath; loggerConfig.WriteTo.File( @@ -88,7 +88,7 @@ public static ILogger CreateDefaultLogger() .WriteTo.Console( outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") .WriteTo.File( - "./Logs/driver-update-.log", + "./Logs/drivelution-.log", rollingInterval: RollingInterval.Day, outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}", retainedFileCountLimit: 30) diff --git a/src/c#/GeneralUpdate.Drivelution/GeneralDrivelution.cs b/src/c#/GeneralUpdate.Drivelution/GeneralDrivelution.cs index 61380646..fd2dd2df 100644 --- a/src/c#/GeneralUpdate.Drivelution/GeneralDrivelution.cs +++ b/src/c#/GeneralUpdate.Drivelution/GeneralDrivelution.cs @@ -21,7 +21,7 @@ namespace GeneralUpdate.Drivelution; /// /// // 带配置使用 /// // With configuration -/// var options = new DriverUpdateOptions { LogLevel = "Info" }; +/// var options = new DrivelutionOptions { LogLevel = "Info" }; /// var updater = GeneralDrivelution.Create(options); /// var result = await updater.UpdateAsync(driverInfo, strategy); /// @@ -35,13 +35,13 @@ public static class GeneralDrivelution /// 配置选项(可选)/ Configuration options (optional) /// 适配当前平台的驱动更新器 / Platform-adapted driver updater /// 当前平台不支持时抛出 / Thrown when platform is not supported - public static IGeneralDrivelution Create(DriverUpdateOptions? options = null) + public static IGeneralDrivelution Create(DrivelutionOptions? options = null) { var logger = options != null ? LoggerConfigurator.ConfigureLogger(options) : LoggerConfigurator.CreateDefaultLogger(); - return Core.DriverUpdaterFactory.Create(logger, options); + return Core.DrivelutionFactory.Create(logger, options); } /// @@ -51,9 +51,9 @@ public static IGeneralDrivelution Create(DriverUpdateOptions? options = null) /// 自定义日志记录器 / Custom logger /// 配置选项(可选)/ Configuration options (optional) /// 适配当前平台的驱动更新器 / Platform-adapted driver updater - public static IGeneralDrivelution Create(ILogger logger, DriverUpdateOptions? options = null) + public static IGeneralDrivelution Create(ILogger logger, DrivelutionOptions? options = null) { - return Core.DriverUpdaterFactory.Create(logger, options); + return Core.DrivelutionFactory.Create(logger, options); } /// @@ -119,8 +119,8 @@ public static PlatformInfo GetPlatformInfo() { return new PlatformInfo { - Platform = Core.DriverUpdaterFactory.GetCurrentPlatform(), - IsSupported = Core.DriverUpdaterFactory.IsPlatformSupported(), + Platform = Core.DrivelutionFactory.GetCurrentPlatform(), + IsSupported = Core.DrivelutionFactory.IsPlatformSupported(), OperatingSystem = CompatibilityChecker.GetCurrentOS(), Architecture = CompatibilityChecker.GetCurrentArchitecture(), SystemVersion = CompatibilityChecker.GetSystemVersion() diff --git a/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs b/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs index 56a54d4a..bb12014d 100644 --- a/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs +++ b/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs @@ -434,7 +434,7 @@ private ErrorInfo CreateErrorInfo(Exception ex, ErrorType type, bool canRetry) { return new ErrorInfo { - Code = ex is DriverUpdateException dex ? dex.ErrorCode : "DU_UNKNOWN", + Code = ex is DrivelutionException dex ? dex.ErrorCode : "DU_UNKNOWN", Type = type, Message = ex.Message, Details = ex.ToString(), From bbff558dc389c020deedb1013bdc03ad1375519e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:13:18 +0000 Subject: [PATCH 3/3] Update error code prefixes from DU_ to DR_ Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com> --- .../Exceptions/DriverUpdateExceptions.cs | 28 +++++++++---------- .../WindowsGeneralDrivelution.cs | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs b/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs index 5ace1349..6205b84c 100644 --- a/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs +++ b/src/c#/GeneralUpdate.Drivelution/Abstractions/Exceptions/DriverUpdateExceptions.cs @@ -9,14 +9,14 @@ public class DrivelutionException : Exception public string ErrorCode { get; set; } public bool CanRetry { get; set; } - public DrivelutionException(string message, string errorCode = "DU_UNKNOWN", bool canRetry = false) + public DrivelutionException(string message, string errorCode = "DR_UNKNOWN", bool canRetry = false) : base(message) { ErrorCode = errorCode; CanRetry = canRetry; } - public DrivelutionException(string message, Exception innerException, string errorCode = "DU_UNKNOWN", bool canRetry = false) + public DrivelutionException(string message, Exception innerException, string errorCode = "DR_UNKNOWN", bool canRetry = false) : base(message, innerException) { ErrorCode = errorCode; @@ -31,12 +31,12 @@ public DrivelutionException(string message, Exception innerException, string err public class DriverPermissionException : DrivelutionException { public DriverPermissionException(string message) - : base(message, "DU_PERMISSION_DENIED", false) + : base(message, "DR_PERMISSION_DENIED", false) { } public DriverPermissionException(string message, Exception innerException) - : base(message, innerException, "DU_PERMISSION_DENIED", false) + : base(message, innerException, "DR_PERMISSION_DENIED", false) { } } @@ -50,13 +50,13 @@ public class DriverValidationException : DrivelutionException public string ValidationType { get; set; } public DriverValidationException(string message, string validationType) - : base(message, "DU_VALIDATION_FAILED", false) + : base(message, "DR_VALIDATION_FAILED", false) { ValidationType = validationType; } public DriverValidationException(string message, string validationType, Exception innerException) - : base(message, innerException, "DU_VALIDATION_FAILED", false) + : base(message, innerException, "DR_VALIDATION_FAILED", false) { ValidationType = validationType; } @@ -69,12 +69,12 @@ public DriverValidationException(string message, string validationType, Exceptio public class DriverInstallationException : DrivelutionException { public DriverInstallationException(string message, bool canRetry = true) - : base(message, "DU_INSTALLATION_FAILED", canRetry) + : base(message, "DR_INSTALLATION_FAILED", canRetry) { } public DriverInstallationException(string message, Exception innerException, bool canRetry = true) - : base(message, innerException, "DU_INSTALLATION_FAILED", canRetry) + : base(message, innerException, "DR_INSTALLATION_FAILED", canRetry) { } } @@ -86,12 +86,12 @@ public DriverInstallationException(string message, Exception innerException, boo public class DriverBackupException : DrivelutionException { public DriverBackupException(string message) - : base(message, "DU_BACKUP_FAILED", true) + : base(message, "DR_BACKUP_FAILED", true) { } public DriverBackupException(string message, Exception innerException) - : base(message, innerException, "DU_BACKUP_FAILED", true) + : base(message, innerException, "DR_BACKUP_FAILED", true) { } } @@ -103,12 +103,12 @@ public DriverBackupException(string message, Exception innerException) public class DriverRollbackException : DrivelutionException { public DriverRollbackException(string message) - : base(message, "DU_ROLLBACK_FAILED", false) + : base(message, "DR_ROLLBACK_FAILED", false) { } public DriverRollbackException(string message, Exception innerException) - : base(message, innerException, "DU_ROLLBACK_FAILED", false) + : base(message, innerException, "DR_ROLLBACK_FAILED", false) { } } @@ -120,12 +120,12 @@ public DriverRollbackException(string message, Exception innerException) public class DriverCompatibilityException : DrivelutionException { public DriverCompatibilityException(string message) - : base(message, "DU_COMPATIBILITY_FAILED", false) + : base(message, "DR_COMPATIBILITY_FAILED", false) { } public DriverCompatibilityException(string message, Exception innerException) - : base(message, innerException, "DU_COMPATIBILITY_FAILED", false) + : base(message, innerException, "DR_COMPATIBILITY_FAILED", false) { } } diff --git a/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs b/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs index bb12014d..0e8ff2be 100644 --- a/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs +++ b/src/c#/GeneralUpdate.Drivelution/Windows/Implementation/WindowsGeneralDrivelution.cs @@ -434,7 +434,7 @@ private ErrorInfo CreateErrorInfo(Exception ex, ErrorType type, bool canRetry) { return new ErrorInfo { - Code = ex is DrivelutionException dex ? dex.ErrorCode : "DU_UNKNOWN", + Code = ex is DrivelutionException dex ? dex.ErrorCode : "DR_UNKNOWN", Type = type, Message = ex.Message, Details = ex.ToString(),