question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Braking Execution of a Template

See original GitHub issue

I tried to use your “ret” command to stop the execution of a template if a pre condition is not filled. But i’ve noticed that this effects other templates too, so they also got not rendered, still if they don’t have such pre conditions. Is there any better option to exit the template execution?

   {{~ if !Settings.FlagA || !Settings.FlagB; ret; end; ~}}

This works well, if i inverse the condition, but that is not my prefered solution:

   {{~ if Settings.FlagA && Settings.FlagB ~}}
   ...
   {{~ end ~}}

I also tried this, with the same strange result:

   {{~ if !Settings.FlagA || !Settings.FlagB ~}}
   {{~ ret ~}}
   {{~ end ~}}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xoofxcommented, Jun 5, 2020

Fixed in 2.1.3 coming later today.

0reactions
endeffectscommented, Jul 27, 2019

thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop a pipeline execution in CodePipeline
The execution is in a Stopping state until the in-progress actions are complete. Then the execution is in a Stopped state. The stage...
Read more >
text/template - Go Packages
Templates are executed by applying them to a data structure. Annotations in the template refer to elements of the data structure (typically a...
Read more >
Can't execute code in break mode
You enter break mode when you suspend execution of code. This error has the following causes and solutions: You tried to run code...
Read more >
Redirect is rendering template rather than stopping ...
I have a Laravel 4 application where I check if the user is authenticated and if not it redirects them to the login...
Read more >
Modeling an Anti-Lock Braking System - MATLAB & Simulink
This example shows how to model a simple model for an Anti-Lock Braking System (ABS). It simulates the dynamic behavior of a vehicle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found