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
Originally posted by davidyell October 29, 2024
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?
The text was updated successfully, but these errors were encountered:
davidyell
changed the title
Can media library validation catch more exceptions in the validation?
Can media library pro validation catch more exceptions in the validation?
Jan 22, 2025
Discussed in #3720
Originally posted by davidyell October 29, 2024
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
?The text was updated successfully, but these errors were encountered: