From 5e484ee3e7302caab3d91e5e34438bf17d3a0c38 Mon Sep 17 00:00:00 2001 From: Ankur Kumar Date: Tue, 1 Mar 2022 12:40:53 +0530 Subject: [PATCH] [9.x] Report file system exceptions Fixes https://github.com/laravel/framework/issues/41269 --- src/Illuminate/Filesystem/FilesystemAdapter.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index f48f66135096..514bc9a8f69a 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -236,7 +236,7 @@ public function get($path) try { return $this->driver->read($path); } catch (UnableToReadFile $e) { - // + report($e); } } @@ -330,6 +330,7 @@ public function put($path, $contents, $options = []) ? $this->driver->writeStream($path, $contents, $options) : $this->driver->write($path, $contents, $options); } catch (UnableToWriteFile $e) { + report($e) return false; } @@ -405,6 +406,7 @@ public function setVisibility($path, $visibility) try { $this->driver->setVisibility($path, $this->parseVisibility($visibility)); } catch (UnableToSetVisibility $e) { + report($e) return false; } @@ -461,6 +463,7 @@ public function delete($paths) try { $this->driver->delete($path); } catch (UnableToDeleteFile $e) { + report($e) $success = false; } } @@ -480,6 +483,7 @@ public function copy($from, $to) try { $this->driver->copy($from, $to); } catch (UnableToCopyFile $e) { + report($e) return false; } @@ -498,6 +502,7 @@ public function move($from, $to) try { $this->driver->move($from, $to); } catch (UnableToMoveFile $e) { + report($e) return false; } @@ -545,7 +550,7 @@ public function readStream($path) try { return $this->driver->readStream($path); } catch (UnableToReadFile $e) { - // + report($e) } } @@ -557,6 +562,7 @@ public function writeStream($path, $resource, array $options = []) try { $this->driver->writeStream($path, $resource, $options); } catch (UnableToWriteFile $e) { + report($e) return false; } @@ -753,6 +759,7 @@ public function makeDirectory($path) try { $this->driver->createDirectory($path); } catch (UnableToCreateDirectory $e) { + report($e) return false; } @@ -770,6 +777,7 @@ public function deleteDirectory($directory) try { $this->driver->deleteDirectory($directory); } catch (UnableToDeleteDirectory $e) { + report($e) return false; }