If you want to access the error message in a catch-block, you should do it like this:
- Set the "Exception Object Type" of the catch-block to "System.Exception" (can be found in the mscorlib).
- Set the "Exception Object Name" of the catch-block to "ex".
- In any expression inside the catch-block, you can now use code such as ex.Message, ex.StackTrace, ...
If you want to throw a new exception, you can use the ThrowException shape. This shape can be a little confusing though. It has an "Exception Object" property which you assign using a drop-down list. When you first drag the shape onto your orchestration, the only item in the list is "General Exception". If you wish to throw a specific exception, you need to create a variable of an exception type. This variable will then be displayed in the drop-down list.
No comments:
Post a Comment