-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
- Laravel Version: 9.x
- PHP Version: Does not matter
- Database Driver & Version: Does not matter
Description:
Storage::put()
and similar methods no longer throws and and silently return false
, the actual error is never logged or visible to developer
Here is responsible code
framework/src/Illuminate/Filesystem/FilesystemAdapter.php
Lines 322 to 336 in d1c3d4f
try { | |
if ($contents instanceof StreamInterface) { | |
$this->driver->writeStream($path, $contents->detach(), $options); | |
return true; | |
} | |
is_resource($contents) | |
? $this->driver->writeStream($path, $contents, $options) | |
: $this->driver->write($path, $contents, $options); | |
} catch (UnableToWriteFile $e) { | |
return false; | |
} | |
return true; |
PR #33612
Steps To Reproduce:
Update your .env
with
FILESYSTEM_DISK=s3
then make a mistake in your AWS credentials or shutdown your minio server
Try to upload a file via Storage::put("test.text","Some text");
Notice that no exception will be thrown, nothing can be found in storage/logs
either.
It is impossible to get underlying adaptor error, (in my case S3)
What can be done next
Throw the exception like before (v8.x) and let end user handle it. OR
Document this change in upgrade guide.
Metadata
Metadata
Assignees
Labels
No labels