Commit 453a5d4f authored by Florian Bogner's avatar Florian Bogner

feat: Improve error message on lock server execution failure

parent bbb4edfe
......@@ -22,9 +22,11 @@ QUI::$Ajax->registerFunction(
try {
$Packages->install($packageName, $packageVersion);
} catch (\Exception $Exception) {
} catch (\QUI\Exception $Exception) {
QUI::getMessagesHandler()->addError($Exception->getMessage());
return false;
} catch (\Exception $Exception) {
return false;
}
......
......@@ -1772,7 +1772,7 @@ class Manager extends QUI\QDOM
if (!$lockServerEnabled && $memoryLimit != -1 && $memoryLimit < 256 * 1024 * 1024) {
throw new QUI\Exception([
'quiqqer/quiqqer',
'message.online.update.RAM.not.enough'
'message.online.update.RAM.insufficient'
]);
}
......@@ -1785,7 +1785,7 @@ class Manager extends QUI\QDOM
try {
$lockContent = $LockClient->update($this->composer_json, $package);
} catch (\Exception $Exception) {
throw new QUI\Exception([
throw new QUI\Lockclient\Exceptions\LockServerException([
'quiqqer/lockclient',
'exception.lockserver.unavilable'
]);
......@@ -1833,10 +1833,10 @@ class Manager extends QUI\QDOM
$memoryLimit = QUI\Utils\System::getMemoryLimit();
if (!$lockServerEnabled && $memoryLimit != -1 && $memoryLimit < 256 * 1024 * 1024) {
throw new QUI\Exception(
throw new QUI\Exception([
'quiqqer/quiqqer',
'message.online.update.RAM.not.enough'
);
'message.online.update.RAM.insufficient'
]);
}
if (!$lockServerEnabled) {
......@@ -1848,7 +1848,7 @@ class Manager extends QUI\QDOM
try {
$lockContent = $LockClient->requirePackage($this->composer_json, $packages, $version);
} catch (\Exception $Exception) {
throw new QUI\Exception([
throw new QUI\Lockclient\Exceptions\LockServerException([
'quiqqer/lockclient',
'exception.lockserver.unavilable'
]);
......
......@@ -775,6 +775,11 @@
<code>[command]</code>
]]></de>
</locale>
<locale name="message.online.update.RAM.insufficient">
<de>
<![CDATA[Für diese Aktion steht Composer nicht genug Arbeitsspeicher zur Verfügung. Bitte erhöhen Sie das Arbeitsspeicher Limit oder führen Sie Composer in der Konsole aus.]]>
</de>
</locale>
<locale name="exception.console.execute.only.in.cli">
<de><![CDATA[System Tools können nur in der CLI ausgeführt werden.]]></de>
</locale>
......
......@@ -772,6 +772,11 @@
<code>[command]</code>
]]></en>
</locale>
<locale name="message.online.update.RAM.insufficient">
<en>
<![CDATA[Composer does not have enough memory available for this action. Please increase the memory limit for PHP or execute Composer in the command line]]>
</en>
</locale>
<locale name="exception.console.execute.only.in.cli">
<en><![CDATA[System tools can only be run in the CLI.]]></en>
</locale>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment