Generate system error

What is the fastest way to generate system error? I want to test the flow.

Also, I want to understand - so I have a variable called SysError with type as System.Exception

Does System.Exception means System Error??

In this State Machine, I have an init state transit to final state if system error occurs.
So in the transition, I put “SysError is not Nothing” in the condition. Is this correct?

And I wonder, does that mean when a system error occurs, that error will be stored in the SysError variable??? Is that an array or…? Is my variable type correct…?

Can you please share a good example of State Machine Error Handling template?

Also, In the Init state, for example, why we put the activities in the ENTRY box instead of the EXIT box? When are we putting things in the EXIT box?

1 Like

Yes, It is type of system exception. If error occur in Init state then it will go End Process state.

1 Like


Put this wherever you want, you will get system exception,

Throw New System.Exception("An exception has occurred.")
1 Like


But I don’t want to throw it. I want a system error, then it will go to Final State…
When I throw it, it doesn’t go to the Final State


I found that a way to generate system error is to have an OPEN excel when I have the read excel activity in the workflow.

Throwing an exception yourself just mimics this. It is easier to throw an exception than it is to open excel manually and try to read from it in your workflow.

This expression should we assign it to any variable or should be given in writeline. And I was getting error while iam trying to use this line. Like some expression is missing. Can you help me with this


Use Throw Activity and in the property we have to use that line of code.