You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am interested to understand if there is a way to have the media library catch more exceptions as validation failures.
We have an occasional bug where we get League\Flysystem\UnableToRetrieveMetadata which comes from the src/Livewire/LivewireUploaderComponent.php class and it's getUploadError() method. This is when media-library tries to validate against a file which does not exist.
The stacktrace seems to indicate that the exception originates from the getUploadError() method.
As you can see, it happily catches any ValidationException but does not handle any exceptions thrown from the Flysystem package, such as the UnableToRetrieveMetadata exception.
Is there a neat way to have any exceptions thrown by Flysystem be caught here and instead this method can throw a ValidationException?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am interested to understand if there is a way to have the media library catch more exceptions as validation failures.
We have an occasional bug where we get
League\Flysystem\UnableToRetrieveMetadata
which comes from thesrc/Livewire/LivewireUploaderComponent.php
class and it'sgetUploadError()
method. This is when media-library tries to validate against a file which does not exist.The stacktrace seems to indicate that the exception originates from the
getUploadError()
method.As you can see, it happily catches any
ValidationException
but does not handle any exceptions thrown from the Flysystem package, such as theUnableToRetrieveMetadata
exception.Is there a neat way to have any exceptions thrown by Flysystem be caught here and instead this method can throw a
ValidationException
?Beta Was this translation helpful? Give feedback.
All reactions