aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-09-17 17:23:33 +0200
committerRobin Appelman <robin@icewind.nl>2020-09-17 17:23:33 +0200
commit43b3049a4f124ca82cc3f99beb51f96e717d7506 (patch)
tree609f44ab8c88e70f441334058a7970f7cc1f1166 /apps/files_external/lib
parentec07ca2abbc88f395b8eeedc4b2e5b679018a673 (diff)
downloadnextcloud-server-43b3049a4f124ca82cc3f99beb51f96e717d7506.tar.gz
nextcloud-server-43b3049a4f124ca82cc3f99beb51f96e717d7506.zip
improve handling of out of space errors for smb
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 404aa4e12de..c7e2583f08d 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -44,6 +44,7 @@ use Icewind\SMB\Exception\Exception;
use Icewind\SMB\Exception\ForbiddenException;
use Icewind\SMB\Exception\InvalidArgumentException;
use Icewind\SMB\Exception\NotFoundException;
+use Icewind\SMB\Exception\OutOfSpaceException;
use Icewind\SMB\Exception\TimedOutException;
use Icewind\SMB\IFileInfo;
use Icewind\SMB\Native\NativeServer;
@@ -57,6 +58,7 @@ use OC\Files\Filesystem;
use OC\Files\Storage\Common;
use OCA\Files_External\Lib\Notify\SMBNotifyHandler;
use OCP\Constants;
+use OCP\Files\EntityTooLargeException;
use OCP\Files\Notify\IChange;
use OCP\Files\Notify\IRenameChange;
use OCP\Files\Storage\INotifyStorage;
@@ -497,6 +499,8 @@ class SMB extends Common implements INotifyStorage {
return false;
} catch (ForbiddenException $e) {
return false;
+ } catch (OutOfSpaceException $e) {
+ throw new EntityTooLargeException("not enough available space to create file", 0, $e);
} catch (ConnectException $e) {
$this->logger->logException($e, ['message' => 'Error while opening file']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
@@ -538,6 +542,8 @@ class SMB extends Common implements INotifyStorage {
return true;
}
return false;
+ } catch (OutOfSpaceException $e) {
+ throw new EntityTooLargeException("not enough available space to create file", 0, $e);
} catch (ConnectException $e) {
$this->logger->logException($e, ['message' => 'Error while creating file']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);