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

[5.x] Improve ImageGenerator Exception handling #10786

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

indykoning
Copy link
Contributor

@indykoning indykoning commented Sep 11, 2024

In the old situation src/Imaging/ImageGenerator.php throws http exceptions while by namespace it has nothing to do with http.
This causes confusing errors when used to pregenerate images since getting the actual error message is impossible and instead you get a 404.

This PR moves throwing the 404 for this error to the controllers running the generator, so exceptions are thrown according to the task that class should perform.
This will make debugging and error handling much better.

caused by: https://github.com/statamic/cms/pull/3450/files#diff-a241fa0e16c263728c96b0f5b5b590e06e14a79e2e7260a3501bba22ceb88755R152
fixes: #10788

@indykoning indykoning changed the title Improve ImageGenerator Exception handling 5.x Improve ImageGenerator Exception handling Sep 11, 2024
@indykoning indykoning changed the title 5.x Improve ImageGenerator Exception handling [5.x] Improve ImageGenerator Exception handling Sep 11, 2024
@jasonvarga jasonvarga merged commit 121607d into statamic:5.x Sep 11, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageGenerator throws http error
2 participants