Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Error in Global Template not caught in local plan



  • I have a Global template that I have a Log Error on which sets the ExecutionState to Error.
    In the local App Plan that calls that template the call is in a Try/Catch block but when this template is executed and results in the state being Error it is not caught.
    The overall execution state is set to Error it just is not caught by the try/catch.

    I know there is the Fail function but I want this to be Caught in the catch statement not just exit outright. Is there a way to do this? Is this a bug?
    Seems like the try/catch in the parent plan should catch this as a error of the template.

    Product: BuildMaster
    Version: 5.8.3



  • From the formal specification:

    Log Statement
    This statement has two elements:

    Log Message – an expression
    Log Level – an integer enum with valid values of (0=Debug, 10=Information, 20=Warning, 30=Error)
    When this statement is encountered, the execution engine writes the specified message to the specified level. If Warning or Error is specified, the execution status will change appropriately (Error causes Failing, Warning causes Warning unless already Failing), but an error will not be raised.

    I think you can accomplish what you want if you use Execute-Powershell instead of Log-Error.

    Execute-Powershell >> Write-Error "Hello World">>;


  • I had seen that which is what I have setup.
    I am more wondering if there is another function like Fail that would cause a Catch to occur.
    I can add something like what you suggest but having some built in function would seem to be a more logical thing to have.



  • I agree. I think intuitively, the throw statement should allow a message to be specified but Write-Error works all the same I guess.



  • Good idea about the throw statement - I've added a feature request with suggested formal grammar to our public issue tracker as IEE-14.

    There are other things we'll have to take into account such as documentation updates and updating the visual plan editor to handle this, so it's not scheduled yet, but at least it is logged.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation