From d11de8c8e7a61bccd09b42cc367a02d104b70bbb Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Wed, 21 Oct 2020 16:03:40 +0200 Subject: Add more details if extract fails. Signed-off-by: Daniel Kesselberg --- lib/private/Archive/TAR.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/private/Archive') diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 0d4103299ce..bf69df0edc6 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -381,4 +381,14 @@ class TAR extends Archive { $types = [null, 'gz', 'bz']; $this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]); } + + /** + * Get error object from archive_tar. + */ + public function getError(): ?\PEAR_Error { + if ($this->tar instanceof \Archive_Tar && $this->tar->error_object instanceof \PEAR_Error) { + return $this->tar->error_object; + } + return null; + } } -- cgit v1.2.3