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

gcode_macro: include lineno in the template exception #495

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

rogerlz
Copy link
Contributor

@rogerlz rogerlz commented Dec 20, 2024

No description provided.

@rogerlz rogerlz marked this pull request as ready for review December 20, 2024 13:28
@rogerlz rogerlz requested a review from a team as a code owner December 20, 2024 13:28
@kageurufu
Copy link
Member

Is lineno within the template?

Jinja has decent exceptions, I feel like we should just show the actual erroring bit of the template

@maz0r
Copy link

maz0r commented Jan 3, 2025

--- nvm tested the wrong thing :p kept getting caught in the python template wrapper :p

New tests
correctly identifies the line within the gcode: section
image
image

works with whitespace (unlike the python wrapper)
image
image

@DanniDesign
Copy link

DanniDesign commented Jan 3, 2025

I can confirm that this also works on my machine
image
image

though, i do think that it would be better to have the line of the whole file. which in that way it would be faster to find the error because now you'd have to find the macro first. So line 375 in this example

@rogerlz
Copy link
Contributor Author

rogerlz commented Jan 7, 2025

though, i do think that it would be better to have the line of the whole file. which in that way it would be faster to find the error because now you'd have to find the macro first. So line 375 in this example

unfortunately it is not possible at the moment due to includes and ordering of it happening..

@rogerlz
Copy link
Contributor Author

rogerlz commented Jan 7, 2025

thanks all for the test

@rogerlz rogerlz merged commit 4ad0b22 into main Jan 7, 2025
2 checks passed
@rogerlz rogerlz deleted the templatelineno branch January 7, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants