Hello, I’m relatively new to WM Development, and have a question about Error Trapping. I want to wrap a DB insert in a Try-Catch block, and when an error occurs (lets say for a null value insert into a not-null column), I want to format that error into a published error document. The problem I’m having is retrieving the exception error to use to populate my new document. Is there any way of accessing the exceptions error message from the catch side of a try-catch block?
Any help on this would be greatly apprecaited. I’ve scoured the wm advantage site, as well as the related program documentation but up to this point I’ve been unable to accomplish this task.
Step 1:
Declare a class level variable
private Exception adapterexception ;
Step 2:
In the scriptInvoke method assign the exception to this variable:
adapterexception = catchStepEx ;
Step 3:
Insert a custom step in the catch side and retrieve the error message into a String and return that variable which can be mapped to a field in an error event.
String errormessage = adapterexception.getMessage();
Hi Rory, .toString will get the error message - if you want the entire stack trace the following will work - you’ll need to add several things in the appropriate places in the script:
will catch error text. Then, you can print declarationStep.stringExceptionMessage using access.println()
or you can assign the declarationStep.stringExceptionMessage to the error text field in Adapter::errorNotify and Adapter::error to publish and deliver.
I am using Enterprise isiebel Adapter to insert data in to Siebel. When I try to insert the value in a field which has a pick list(LOV) associated with it, I get an error saying value does not match with any value in th bounded pick list. But the value exist in the pick list. When I use same value from Siebel front end application, it works. Does any one has idea, why it’s not considering the input to be one of the value in pick list?
I’m trying to implement the EI error logic suggested by ZGW and need a little help…
In my EI (version 6.0.1) I added the ErrorCatchStep to my flow diagram. In my try step I execute an operation. I assume I add the code mentionned in my Catch step… is this done by using the Custom Code Script?