Skip to content

Commit d2dce63

Browse files
author
Sébastien Nikolaou
authored
[9.x] Catch permission exception when creating directory (#41871)
* Catch permission exception when creating directory * Catch permission exception when writing files
1 parent 0b67a6f commit d2dce63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Illuminate/Filesystem/FilesystemAdapter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public function put($path, $contents, $options = [])
344344
is_resource($contents)
345345
? $this->driver->writeStream($path, $contents, $options)
346346
: $this->driver->write($path, $contents, $options);
347-
} catch (UnableToWriteFile $e) {
347+
} catch (UnableToWriteFile|UnableToSetVisibility $e) {
348348
throw_if($this->throwsExceptions(), $e);
349349

350350
return false;
@@ -581,7 +581,7 @@ public function writeStream($path, $resource, array $options = [])
581581
{
582582
try {
583583
$this->driver->writeStream($path, $resource, $options);
584-
} catch (UnableToWriteFile $e) {
584+
} catch (UnableToWriteFile|UnableToSetVisibility $e) {
585585
throw_if($this->throwsExceptions(), $e);
586586

587587
return false;
@@ -779,7 +779,7 @@ public function makeDirectory($path)
779779
{
780780
try {
781781
$this->driver->createDirectory($path);
782-
} catch (UnableToCreateDirectory $e) {
782+
} catch (UnableToCreateDirectory|UnableToSetVisibility $e) {
783783
throw_if($this->throwsExceptions(), $e);
784784

785785
return false;

0 commit comments

Comments
 (0)