-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9.x] Storage::put() no longer throws an exception #41269
Comments
Flysystem v2 & v3 now throw I've sent in a PR to the upgrade guide: laravel/docs#7755 We are however, maybe considering to implement an optional logger to log these exceptions instead. |
Suppressing such exceptions is a bad idea. Since this behaviour was not documented in upgrade guide, it should be easy to bring back old behaviour, or at-least throw a custom exception to halt the execution. |
I personally too, more prefer exception throwing. However, we decided to pursue boolean returns instead to consolidate the workings of the filesystem.
We cannot do that as Laravel v9 is now a month old and doing this will introduce breaking changes for apps that already upgraded. |
This comment was marked as abuse.
This comment was marked as abuse.
Hey all! We have an idea for improving this for you - going to look into it. |
I am a newbie to Laravel, but experienced in other languages/frameworks. Quite impressed with Laravel's developer friendliness overall. However, when trying to integrate with cloud storage, i did end up in a situation where there was no way to know what went wrong. I happened to see Could you please mention the existence of Really appreciate all the hard work ! |
We can always review a PR if you can send one 👍 |
@driesvints Sure, i have opened PR: laravel/docs#8961 |
Description:
Storage::put()
and similar methods no longer throws and and silently returnfalse
, the actual error is never logged or visible to developerHere is responsible code
framework/src/Illuminate/Filesystem/FilesystemAdapter.php
Lines 322 to 336 in d1c3d4f
PR #33612
Steps To Reproduce:
Update your
.env
withFILESYSTEM_DISK=s3
then make a mistake in your AWS credentials or shutdown your minio serverTry 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.
The text was updated successfully, but these errors were encountered: