Skip to content

Commit ef07ca7

Browse files
icewind1991backportbot[bot]
authored andcommitted
improve handling of out of space errors for smb
Signed-off-by: Robin Appelman <[email protected]>
1 parent be1bcac commit ef07ca7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • apps/files_external/lib/Lib/Storage

apps/files_external/lib/Lib/Storage/SMB.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
use Icewind\SMB\Exception\ForbiddenException;
4343
use Icewind\SMB\Exception\InvalidArgumentException;
4444
use Icewind\SMB\Exception\NotFoundException;
45+
use Icewind\SMB\Exception\OutOfSpaceException;
4546
use Icewind\SMB\Exception\TimedOutException;
4647
use Icewind\SMB\IFileInfo;
4748
use Icewind\SMB\Native\NativeServer;
@@ -460,6 +461,8 @@ public function fopen($path, $mode) {
460461
return false;
461462
} catch (ForbiddenException $e) {
462463
return false;
464+
} catch (OutOfSpaceException $e) {
465+
throw new EntityTooLargeException("not enough available space to create file", 0, $e);
463466
} catch (ConnectException $e) {
464467
$this->logger->logException($e, ['message' => 'Error while opening file']);
465468
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
@@ -501,6 +504,8 @@ public function touch($path, $time = null) {
501504
return true;
502505
}
503506
return false;
507+
} catch (OutOfSpaceException $e) {
508+
throw new EntityTooLargeException("not enough available space to create file", 0, $e);
504509
} catch (ConnectException $e) {
505510
$this->logger->logException($e, ['message' => 'Error while creating file']);
506511
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);

0 commit comments

Comments
 (0)