diff --git a/src/WingetCreateCLI/Commands/BaseCommand.cs b/src/WingetCreateCLI/Commands/BaseCommand.cs index 3ba7765f..35a15618 100644 --- a/src/WingetCreateCLI/Commands/BaseCommand.cs +++ b/src/WingetCreateCLI/Commands/BaseCommand.cs @@ -284,7 +284,15 @@ protected static async Task DownloadPackageFile(string installerUrl) if (e is HttpRequestException httpRequestException) { - Logger.ErrorLocalized(nameof(Resources.HttpResponseUnsuccessful_Error), httpRequestException.StatusCode); + if (httpRequestException.StatusCode != null) + { + Logger.ErrorLocalized(nameof(Resources.HttpResponseUnsuccessful_Error), httpRequestException.StatusCode); + } + else + { + Logger.ErrorLocalized(nameof(Resources.Error_Prefix), httpRequestException.Message); + } + return null; }