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

Improve template names and line numbers in error messages #53

Open
jg-rp opened this issue Apr 22, 2022 · 2 comments
Open

Improve template names and line numbers in error messages #53

jg-rp opened this issue Apr 22, 2022 · 2 comments
Labels
version 2 Fix or include in version 2 of Python Liquid

Comments

@jg-rp
Copy link
Owner

jg-rp commented Apr 22, 2022

While Python Liquid's error messages do contain template names and offending line numbers where possible, there is room for improvement, especially for expressions that span multiple lines.

The error message format implemented in LiquidScript seems more readable, and LiquidScript keeps track of the starting index of each token in template source text, rather than a line number, resulting in more accurate error messages.

@jg-rp jg-rp added the version 2 Fix or include in version 2 of Python Liquid label Apr 22, 2022
@janwirth
Copy link

I consider chumsky / ariadne error reporting for parser to be the best out there right now:
https://github.com/zesterer/chumsky

@jg-rp
Copy link
Owner Author

jg-rp commented Jan 11, 2025

Python Liquid2 includes more context info in exceptions and much improved error messages (example).

In time, if there's a demand, we'll implement something similar here too. This will require a major update to the scanner/lexer (needed for #136 as well), a redefinition of Token and a change to the base Error exception API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version 2 Fix or include in version 2 of Python Liquid
Projects
None yet
Development

No branches or pull requests

2 participants