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

Handle custom errors in Alchemy::Picture#url #1305

Merged
merged 2 commits into from
Sep 1, 2017

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Aug 31, 2017

Currently we raise custom errors in the Alchemy::Picture#url
method without rescueing them later. This causes pages and the image library
to fail completely if one the images could not be rendered because the image file
is missing or the image format could not be used.

This is bad user experience. We should not display the broken image and not break the whole page.

@tvdeyen tvdeyen changed the base branch from master to 3.6-stable August 31, 2017 20:22
@AlchemyCMS AlchemyCMS deleted a comment from houndci-bot Aug 31, 2017
@tvdeyen tvdeyen requested a review from mamhoff August 31, 2017 20:23
When using log_warning to log a warning to Rails logger
we pass the line of the caller. As the instance method
delegates to the class method we need to use the second line
of the callstack.
Currently we raise custom errors in the Alchemy::Picture#url
method without rescueing them later. This causes pages and the image library
to fail completely if one the images could not be rendered because the image file
is missing or the image format could not be used.

This is bad user experience. We should not display the broken image and not break the whole page.
@tvdeyen tvdeyen merged commit 32a0638 into AlchemyCMS:3.6-stable Sep 1, 2017
@tvdeyen tvdeyen deleted the handle-picture-errors branch September 1, 2017 08:47
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.

2 participants