Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    buildmaster
    5 Posts 3 Posters 10 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jstarbird_7831
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • J Offline
        jharbison
        last edited by

        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">>;
        
        1 Reply Last reply Reply Quote 0
        • J Offline
          jstarbird_7831
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jharbison
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation