Skip to content
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

publicUrl method check looks for wrong exception. #1445

Closed
wizhippo opened this issue Apr 22, 2024 · 1 comment
Closed

publicUrl method check looks for wrong exception. #1445

wizhippo opened this issue Apr 22, 2024 · 1 comment

Comments

@wizhippo
Copy link

wizhippo commented Apr 22, 2024

https://github.com/dustin10/VichUploaderBundle/blame/ec9ad4b732c0d9063e6bf0221bb758ac405d64a2/src/Storage/FlysystemStorage.php#L123

This is catching the wrong exception.

It is throwing Symfony\Component\ErrorHandler\Error\UndefinedMethodError not FilesystemException

Seems this method is on Flysystem 3.6 onward.
My deps currently use 2.x

To support 2.x should allow either exception?

Related to but not the same isuse: #1444

wizhippo added a commit to wizhippo/VichUploaderBundle that referenced this issue Apr 22, 2024
@bountyhub-bot
Copy link

🚀 Bounty Alert!

💰 A bounty of $10.00 has been created by makraz on BountyHub.

🔗 Claim this bounty by submitting a pull request that solves the issue!

Good luck, and happy coding! 💻

regis-martini added a commit to regis-martini/VichUploaderBundle that referenced this issue Oct 30, 2024
Related to dustin10#1445

Add handling for UndefinedMethodError exception in FlysystemStorage.

* Catch both `FilesystemException` and `UndefinedMethodError` exceptions in the `publicUrl` method of `src/Storage/FlysystemStorage.php`.
* Add a test case in `tests/Storage/Flysystem/AbstractFlysystemStorageTestCase.php` to check for `UndefinedMethodError` exception handling in the `resolveUri` method.
* Ensure the test case covers both exceptions to maintain compatibility with different Flysystem versions.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/dustin10/VichUploaderBundle/issues/1445?shareId=XXXX-XXXX-XXXX-XXXX).
garak pushed a commit that referenced this issue Oct 31, 2024
* Fix exception handling in FlysystemStorage

Related to #1445

Add handling for UndefinedMethodError exception in FlysystemStorage.

* Catch both `FilesystemException` and `UndefinedMethodError` exceptions in the `publicUrl` method of `src/Storage/FlysystemStorage.php`.
* Add a test case in `tests/Storage/Flysystem/AbstractFlysystemStorageTestCase.php` to check for `UndefinedMethodError` exception handling in the `resolveUri` method.
* Ensure the test case covers both exceptions to maintain compatibility with different Flysystem versions.
@garak garak closed this as completed Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants