Skip to content

Conversation

@jasmith-hs
Copy link
Contributor

We haven't implemented handling of {% break %} or {% continue %} in eager execution fully so they must create deferred nodes rather than deferred tokens when used in deferred for loops or deferred if statements within for loops.

The latter was handled, but the former was not handled correctly as we'd end up throwing a NotInLoopException rather than a DeferredValueException:

com.hubspot.jinjava.interpret.NotInLoopException: `continue` called while not in a for loop

evaluate continue or break in a deferred for loop
@jasmith-hs jasmith-hs merged commit 1e6ff21 into master Oct 22, 2025
3 checks passed
@jasmith-hs jasmith-hs deleted the handle-continue-used-in-deferred-for-loop branch October 22, 2025 18:10
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.

3 participants