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

Fail on non successful network requests #288

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomek-ac
Copy link

@tomek-ac tomek-ac commented Nov 13, 2023

With :network strategy the gem doesn't fail when the stylesheet doesn't exist at given url (404).
This results in emails being sent without styling.

We would like the gem to raise an exception if for whatever reason our CDN styles are not accessible.

In the proposed PR the loader will return a response only when the response was successful (2xx). Otherwise it will return nil which will result in Premailer::Rails::CSSHelper::FileNotFound being raised.

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.

1 participant