Improved error reporting for failed updates due to missing package servers
authorAlexander Ebert <ebert@woltlab.com>
Thu, 13 Feb 2020 19:30:35 +0000 (20:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 13 Feb 2020 19:30:35 +0000 (20:30 +0100)
wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 7bb81aa33cdd61ede692150e27073efeb49fec56..3c33202634b2f6cc55806476f2fa7beb2dad65df 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\package\Package;
 use wcf\data\package\PackageCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\HTTPUnauthorizedException;
+use wcf\system\exception\NamedUserException;
 use wcf\system\exception\SystemException;
 use wcf\system\io\File;
 use wcf\system\WCF;
@@ -560,7 +561,12 @@ class PackageInstallationScheduler {
         */
        protected function findShortestUpdateThread($package, $fromversions, $currentVersion, $newVersion) {
                if (!isset($fromversions[$newVersion])) {
-                       throw new SystemException("An update of package ".$package." from version ".$currentVersion." to ".$newVersion." is not supported.");
+                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.acp.package.update.path.unknown', [
+                               'currentVersion' => $currentVersion,
+                               'newVersion' => $newVersion,
+                               'package' => $package,
+                               'packageName' => PackageCache::getInstance()->getPackageByIdentifier($package)->getName(),
+                       ]));
                }
                
                // find direct update
@@ -592,7 +598,12 @@ class PackageInstallationScheduler {
                }
                
                if (empty($updateThreadList)) {
-                       throw new SystemException("An update of package ".$package." from version ".$currentVersion." to ".$newVersion." is not supported.");
+                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.acp.package.update.path.incoherent', [
+                               'currentVersion' => $currentVersion,
+                               'newVersion' => $newVersion,
+                               'package' => $package,
+                               'packageName' => PackageCache::getInstance()->getPackageByIdentifier($package)->getName(),
+                       ]));
                }
                
                // sort by length
index 0c55faf373d65d32c8792925ab1e69af3eb6bd03..e401b652eb52f414ca25c1eacde20c95f51adc69 100644 (file)
@@ -1588,6 +1588,8 @@ Als Benachrichtigungs-URL in der Konfiguration der sofortigen Zahlungsbestätigu
                <item name="wcf.acp.package.update.excludedPackages.excluding"><![CDATA[Zu installierende Pakete]]></item>
                <item name="wcf.acp.package.update.excludedPackages.excluding.description"><![CDATA[Die folgenden zu installierenden Pakete sind mit installierten Paketen nicht kompatibel]]></item>
                <item name="wcf.acp.package.update.excludedPackages.excluding.package"><![CDATA[„{$excludedPackage[packageName]}“ in Version „{$excludedPackage[packageVersion]}“ ist mit dem bereits installieren Paket „{$excludedPackage[existingPackageName]}“ nicht kompatibel]]></item>
+               <item name="wcf.acp.package.update.path.incoherent"><![CDATA[Das Update erfordert eine Aktualisierung des Paketes „{$packageName}“ (installierte Version: {$currentVersion}) auf Version {$newVersion}, es wurden aber keine passenden Updates gefunden.]]></item>
+               <item name="wcf.acp.package.update.path.unknown"><![CDATA[Das Update erfordert eine Aktualisierung des Paketes „{$packageName}“ (installierte Version: {$currentVersion}) auf Version {$newVersion}, es wurden aber keine verfügbaren Updates gefunden. Möglicherweise fehlt der passende Paket-Server?]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>
                <item name="wcf.acp.package.packageDir.input"><![CDATA[Installationsverzeichnis]]></item>
                <item name="wcf.acp.package.upload"><![CDATA[Paket hochladen]]></item>
index 1138c339dbd1d561fddfad64df3118bfd611c8e7..21be175a1492863248656aa1441198a29cda8cf5 100644 (file)
@@ -1584,6 +1584,8 @@ When prompted for the notification URL for the instant payment notifications, pl
                <item name="wcf.acp.package.update.excludedPackages.excluding"><![CDATA[Packages to be installed]]></item>
                <item name="wcf.acp.package.update.excludedPackages.excluding.description"><![CDATA[The following packages to be installed are not compatible with the currently installed packages.]]></item>
                <item name="wcf.acp.package.update.excludedPackages.excluding.package"><![CDATA[“{$excludedPackage[packageName]}” in version “{$excludedPackage[packageVersion]}” cannot be installed because it is incompatible with the installed package “{$excludedPackage[existingPackageName]}”.]]></item>
+               <item name="wcf.acp.package.update.path.incoherent"><![CDATA[The update requires the newer version {$newVersion} of the package “{$packageName}” (installed version: {$currentVersion}), but there is no such update available.]]></item>
+               <item name="wcf.acp.package.update.path.unknown"><![CDATA[The update requires the newer version {$newVersion} of the package “{$packageName}” (installed version: {$currentVersion}), but no such update could be found. Perhaps you are missing the required package server?]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>
                <item name="wcf.acp.package.packageDir.input"><![CDATA[Installation Directory]]></item>
                <item name="wcf.acp.package.upload"><![CDATA[Upload package]]></item>