Skip to content

Commit

Permalink
gcode_macro: include lineno in the template exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz committed Dec 20, 2024
1 parent ec8edf3 commit 176810d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exclude: "^docs/|config/|lib/"
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
3 changes: 2 additions & 1 deletion klippy/extras/gcode_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def __init__(self, printer, env, name, script):
try:
self.template = env.from_string(script)
except Exception as e:
msg = "Error loading template '%s': %s" % (
msg = "Error loading template '%s' (line: %s): %s" % (
name,
e.lineno,
traceback.format_exception_only(type(e), e)[-1],
)
logging.exception(msg)
Expand Down

0 comments on commit 176810d

Please sign in to comment.