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

Invalid mjml silently fails #24

Closed
jipiboily opened this issue Jan 23, 2018 · 4 comments
Closed

Invalid mjml silently fails #24

jipiboily opened this issue Jan 23, 2018 · 4 comments

Comments

@jipiboily
Copy link

If you input invalid mjml, mjml-rails doesn't raise any error and just siltenly fails.

Example:

<mj-section>
        <mj-column>
            <mj-text align="left"> Some text for your preheader</mj-text>
        </mj-column>
        <mj-column>
            <mj-text align="right"><a href="email-permalink"> Read in the browser </a></mj-text>
        </mj-column>
      </mj-section>
      <mj-section background-url="https://mjml.io/assets/img/background-url.jpg">
          <mj-column>
              <mj-image src="https://metricswatch.com/wp-content/uploads/2017/04/mwatch-WIP-logo@2x.png"></mj-image>
              <mj-text align="center"> Lorem ipsum </mj-text>
              <mj-button> Discover <%= 2 %> </mj-button>
          </mj-column>
      </mj-section>

This doesn't render and returns nothing (nil or empty string, not sure, didn't check).

It would be relatively easy to catch MJMLError or something like that and raise when we get that from the external rendering through the npm module.

Thoughts?

@sighmon
Copy link
Owner

sighmon commented Jan 26, 2018

@jipiboily When I built this gem, mjml on the command line was failing silently too, so if they've introduced errors now and you can see an easy way to catch them and raise them in Rails, then please do add those changes.

@jipiboily
Copy link
Author

It looks like a bunch of errors are still silent.

If I dig into the code again or face silent errors I might tackle this. I don't have much free time right now, though.

@sighmon
Copy link
Owner

sighmon commented Jan 31, 2018

@jipiboily No problems, thanks for checking it out. I'll leave this issue open for the future. :-)

@sighmon
Copy link
Owner

sighmon commented Apr 3, 2018

@jipiboily solved by #27

@sighmon sighmon closed this as completed Apr 3, 2018
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

No branches or pull requests

2 participants