aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Installer.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-22 12:51:47 +0200
committerGitHub <noreply@github.com>2020-10-22 12:51:47 +0200
commit2ba34cba2c571c8a3e5315b79b8a627af2079ab6 (patch)
tree40d95a7ce71e1bbe3c2c5651bfca9a6cee394420 /lib/private/Installer.php
parenta7470576cfbc36da3230d6038a632e19db8669de (diff)
parentd11de8c8e7a61bccd09b42cc367a02d104b70bbb (diff)
downloadnextcloud-server-2ba34cba2c571c8a3e5315b79b8a627af2079ab6.tar.gz
nextcloud-server-2ba34cba2c571c8a3e5315b79b8a627af2079ab6.zip
Merge pull request #23608 from nextcloud/enh/23482/forward-error-message
Add more details if extract fails
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r--lib/private/Installer.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 47d6c42d518..9388711697a 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -294,12 +294,14 @@ class Installer {
if ($archive) {
if (!$archive->extract($extractDir)) {
- throw new \Exception(
- sprintf(
- 'Could not extract app %s',
- $appId
- )
- );
+ $errorMessage = 'Could not extract app ' . $appId;
+
+ $archiveError = $archive->getError();
+ if ($archiveError instanceof \PEAR_Error) {
+ $errorMessage .= ': ' . $archiveError->getMessage();
+ }
+
+ throw new \Exception($errorMessage);
}
$allFiles = scandir($extractDir);
$folders = array_diff($allFiles, ['.', '..']);