commit b83529b2dd56484e9a907eebfe6c0f37bf7cfdcb parent 40d9cd3bc7839e1c3fe78b4bfccf32fd6001c9bd Author: Kaleb Luedtke <trenlymc@gmail.com> Date: Wed, 10 May 2023 17:50:45 -0500 Add Friendlier Messages for Error Codes (#3201) Diffstat:
| M | src/AppInstallerSharedLib/Errors.cpp | | | 75 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- |
1 file changed, 71 insertions(+), 4 deletions(-)
diff --git a/src/AppInstallerSharedLib/Errors.cpp b/src/AppInstallerSharedLib/Errors.cpp @@ -237,15 +237,15 @@ namespace AppInstaller case APPINSTALLER_CLI_ERROR_INSTALL_INSUFFICIENT_MEMORY: return "There's not enough memory available to install. Close other applications then try again."; case APPINSTALLER_CLI_ERROR_INSTALL_NO_NETWORK: - return "This application requires internet connectivity.Connect to a network then try again."; + return "This application requires internet connectivity. Connect to a network then try again."; case APPINSTALLER_CLI_ERROR_INSTALL_CONTACT_SUPPORT: - return "This application encountered an error during installation.Contact support."; + return "This application encountered an error during installation. Contact support."; case APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_REQUIRED_TO_FINISH: return "Restart your PC to finish installation."; case APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_REQUIRED_TO_INSTALL: - return "Your PC will restart to finish installation."; - case APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_INITIATED: return "Installation failed. Restart your PC then try again."; + case APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_INITIATED: + return "Your PC will restart to finish installation."; case APPINSTALLER_CLI_ERROR_INSTALL_CANCELLED_BY_USER: return "You cancelled the installation."; case APPINSTALLER_CLI_ERROR_INSTALL_ALREADY_INSTALLED: @@ -262,6 +262,73 @@ namespace AppInstaller return "Invalid parameter."; case APPINSTALLER_CLI_ERROR_INSTALL_SYSTEM_NOT_SUPPORTED: return "Package not supported by the system."; + + // Status values for check package installed status results. + case WINGET_INSTALLED_STATUS_ARP_ENTRY_NOT_FOUND: + return "The Apps and Features Entry for the package could not be found."; + case WINGET_INSTALLED_STATUS_INSTALL_LOCATION_NOT_APPLICABLE: + return "The install location is not applicable."; + case WINGET_INSTALLED_STATUS_INSTALL_LOCATION_NOT_FOUND: + return "The install location could not be found."; + case WINGET_INSTALLED_STATUS_FILE_HASH_MISMATCH: + return "The hash of the existing file did not match."; + case WINGET_INSTALLED_STATUS_FILE_NOT_FOUND: + return "File not found."; + case WINGET_INSTALLED_STATUS_FILE_FOUND_WITHOUT_HASH_CHECK: + return "The file was found but the hash was not checked."; + case WINGET_INSTALLED_STATUS_FILE_ACCESS_ERROR: + return "The file could not be accessed."; + + // Configuration Errors + case WINGET_CONFIG_ERROR_INVALID_CONFIGURATION_FILE: + return "The configuration file is invalid."; + case WINGET_CONFIG_ERROR_INVALID_YAML: + return "The YAML syntax is invalid."; + case WINGET_CONFIG_ERROR_INVALID_FIELD_TYPE: + return "A configuration field has an invalid type."; + case WINGET_CONFIG_ERROR_UNKNOWN_CONFIGURATION_FILE_VERSION: + return "The configuration has an unknown version."; + case WINGET_CONFIG_ERROR_SET_APPLY_FAILED: + return "An error occurred while applying the configuration."; + case WINGET_CONFIG_ERROR_DUPLICATE_IDENTIFIER: + return "The configuration contains a duplicate identifier."; + case WINGET_CONFIG_ERROR_MISSING_DEPENDENCY: + return "The configuration is missing a dependency."; + case WINGET_CONFIG_ERROR_DEPENDENCY_UNSATISFIED: + return "The configuration has an unsatisfied dependency."; + case WINGET_CONFIG_ERROR_ASSERTION_FAILED: + return "An assertion for the configuration unit failed."; + case WINGET_CONFIG_ERROR_MANUALLY_SKIPPED: + return "The configuration was manually skipped."; + case WINGET_CONFIG_ERROR_WARNING_NOT_ACCEPTED: + return "A warning was thrown and the user declined to continue execution."; + case WINGET_CONFIG_ERROR_SET_DEPENDENCY_CYCLE: + return "The dependency graph contains a cycle which cannot be resolved."; + case WINGET_CONFIG_ERROR_INVALID_FIELD_VALUE: + return "The configuration has an invalid field value."; + case WINGET_CONFIG_ERROR_MISSING_FIELD: + return "The configuration is missing a field."; + + // Configuration Processor Errors + case WINGET_CONFIG_ERROR_UNIT_NOT_INSTALLED: + return "The configuration unit was not installed."; + case WINGET_CONFIG_ERROR_UNIT_NOT_FOUND_REPOSITORY: + return "The configuration unit could not be found."; + case WINGET_CONFIG_ERROR_UNIT_MULTIPLE_MATCHES: + return "Multiple matches were found for the configuration unit; specify the module to select the correct one."; + case WINGET_CONFIG_ERROR_UNIT_INVOKE_GET: + return "The configuration unit failed while attempting to get the current system state."; + case WINGET_CONFIG_ERROR_UNIT_INVOKE_TEST: + return "The configuration unit failed while attempting to test the current system state."; + case WINGET_CONFIG_ERROR_UNIT_INVOKE_SET: + return "The configuration unit failed while attempting to apply the desired state."; + case WINGET_CONFIG_ERROR_UNIT_MODULE_CONFLICT: + return "The module for the configuration unit is available in multiple locations with the same version."; + case WINGET_CONFIG_ERROR_UNIT_IMPORT_MODULE: + return "Loading the module for the configuration unit failed."; + case WINGET_CONFIG_ERROR_UNIT_INVOKE_INVALID_RESULT: + return "The configuration unit returned an unexpected result during execution."; + default: return "Unknown Error Code"; }