You are viewing limited content. For full access, please sign in.

Question

Question

Workflow, the Try-Catch activity and triggering an exception in script.

asked on March 26, 2014 Show version history

 So I have a customer who is unable to generate an exception that will trigger the try catch activity in workflow. They are on 9.1.1

 

They have this example SDK script:

 

        /// <summary>
        /// This method is run when the activity is performed.
        /// </summary>
        protected override void Execute()
        {
            try
            {
                  Do work and it fails!!!
            }
            catch (Exception e)
            {
                 // This error is caught and we throw the exception to the WorkFlow 
                throw new LaserficheException("Script threw exception", e);
            }
        }
    }

 

When they run this as part of a try-catch activity (shown above) it comes back as a a warning which skips the catch branch. We've gone into the catch settings and set it for anything and we've specified the actual exception. We've also tried switching it to one of the system exceptions the catch activity is aware of. 

 

The customer is aware of returning a token and using a conditional to then effectively do the same procedures that a catch would do but would prefer to "use the tools as they were designed", especially when he wants to potentially catch exceptions he didn't plan for. 

 

 

Anyone have any ideas?

 

0 0

Answer

SELECTED ANSWER
replied on March 26, 2014

The default is to record all script errors as warnings. You can change that option per script activity from the advanced tab in the Properties pane (available under the gear icon in the top right corner of the Properties pane, right next to the help button). Or you can change it for all your scripts in the Scripting Options dialog in the WF Admin Console.

4 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.