Track Current Processed Node In The Context #760
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
I'd like to provide more detail when an exception is fired as a result of processing a macro block. The use case is something like the following:
I have a main template file that has the following snippet:
the macro has something like the following:
So the first item renders as expected...in the second case it fails because it is not a supported language because of the
assert:contains
...however the error I’d like to report back is something like the following:I can get the current line via the interpreter (that would give me line 2 of the macro function) but I’d like to include more detail namely the original expression that dispatched to the macro function if at all possible. This is particularly useful if
macro.translateWord
is initiated often for example.