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
Better Liquid tag error handling #1511
Comments
|
This contains useful information as well #7898 |
|
This issue is available? Can I give it a try? |
|
Yes @marcospedro97 . Please give it a try! |
|
While working in the issue I've manged to catch more errors than we have currently, the main problem I've seen on issue #7898 is that even with the problem the post was created, using the |
Is your feature request related to a problem? Please describe.
Whenever there's an error in the liquid tag, the editor should try it's best to inform the author what went wrong and not display the dreaded
Liquid error: internal. This has also proven to be difficult to debug in development.Describe the solution you'd like
Currently, we are making our individual custom liquid tag to raise
StandardErrorupon initialization if there's an...ArgumentError. We are doing this because any form of error that happens within#renderwill throw aLiquid error: internal.A better solution would be to let Liquid parse normally, ie
Liquid::Template.parse(sanitized_content), then check for errors withLiquid.errors. This also has the added benefit of catching multiple errors at once, letting them be added to errors to be displayed in the view.Describe alternatives you've considered
There could be a better solution I've missed in this documentation.
Additional context
This should also account both of our editor versions.
The text was updated successfully, but these errors were encountered: