From f692fc36a9561ade2ca5050d4fdb6f9b85a47849 Mon Sep 17 00:00:00 2001 From: Geert Doornbos Date: Thu, 23 May 2019 14:10:43 +0200 Subject: [PATCH] Packaging: Fixing that trying to install a package that doesn't exist should display a relevant error notification, fixes #6533 --- .../Modules/Orchard.Packaging/Services/PackageInstaller.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackageInstaller.cs b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackageInstaller.cs index 9e7ccd689..82f7dadb1 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackageInstaller.cs +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Services/PackageInstaller.cs @@ -54,7 +54,9 @@ namespace Orchard.Packaging.Services { var packageVersion = String.IsNullOrEmpty(version) ? null : new Version(version); var package = packageRepository.FindPackage(packageId, packageVersion); if (package == null) { - throw new ArgumentException(T("The specified package could not be found, id:{0} version:{1}", packageId, String.IsNullOrEmpty(version) ? T("No version").Text : version).Text); + var message = T("The specified package could not be found: ID: {0}, version: {1}.", + packageId, string.IsNullOrEmpty(version) ? T("No version").Text : version); + throw new OrchardException(message); } return InstallPackage(package, packageRepository, location, applicationPath);