log the exception during zip creation
This commit is contained in:
parent
b5dce05cb6
commit
def8e0c12a
|
@ -173,24 +173,14 @@ class OC_Files {
|
||||||
} else {
|
} else {
|
||||||
\OC\Files\Filesystem::readfile($filename);
|
\OC\Files\Filesystem::readfile($filename);
|
||||||
}
|
}
|
||||||
if ($getType === self::FILE) {
|
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
|
||||||
$view->unlockFile($filename, ILockingProvider::LOCK_SHARED);
|
|
||||||
}
|
|
||||||
if ($getType === self::ZIP_FILES) {
|
|
||||||
foreach ($files as $file) {
|
|
||||||
$file = $dir . '/' . $file;
|
|
||||||
$view->unlockFile($file, ILockingProvider::LOCK_SHARED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($getType === self::ZIP_DIR) {
|
|
||||||
$file = $dir . '/' . $files;
|
|
||||||
$view->unlockFile($file, ILockingProvider::LOCK_SHARED);
|
|
||||||
}
|
|
||||||
} catch (\OCP\Lock\LockedException $ex) {
|
} catch (\OCP\Lock\LockedException $ex) {
|
||||||
|
OC::$server->getLogger()->logException($ex);
|
||||||
$l = \OC::$server->getL10N('core');
|
$l = \OC::$server->getL10N('core');
|
||||||
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
|
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
|
||||||
\OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint);
|
\OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint);
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
|
OC::$server->getLogger()->logException($ex);
|
||||||
$l = \OC::$server->getL10N('core');
|
$l = \OC::$server->getL10N('core');
|
||||||
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
|
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
|
||||||
\OC_Template::printErrorPage($l->t('Can\'t read file'), $hint);
|
\OC_Template::printErrorPage($l->t('Can\'t read file'), $hint);
|
||||||
|
@ -278,4 +268,27 @@ class OC_Files {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $dir
|
||||||
|
* @param $files
|
||||||
|
* @param $getType
|
||||||
|
* @param $view
|
||||||
|
* @param $filename
|
||||||
|
*/
|
||||||
|
private static function unlockAllTheFiles($dir, $files, $getType, $view, $filename) {
|
||||||
|
if ($getType === self::FILE) {
|
||||||
|
$view->unlockFile($filename, ILockingProvider::LOCK_SHARED);
|
||||||
|
}
|
||||||
|
if ($getType === self::ZIP_FILES) {
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$file = $dir . '/' . $file;
|
||||||
|
$view->unlockFile($file, ILockingProvider::LOCK_SHARED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($getType === self::ZIP_DIR) {
|
||||||
|
$file = $dir . '/' . $files;
|
||||||
|
$view->unlockFile($file, ILockingProvider::LOCK_SHARED);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue