Author |
Message
|
Esa |
Posted: Thu Dec 15, 2011 6:35 am Post subject: throwing an existing ExceptionList |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
I'm wondering if there is a simple way to throw an existing ExceptionList from a node wired from a failure terminal? |
|
Back to top |
|
 |
inMo |
Posted: Thu Dec 15, 2011 7:09 am Post subject: |
|
|
 Master
Joined: 27 Jun 2009 Posts: 216 Location: NY
|
Search the help files for RESIGNAL. Does that meet your req? |
|
Back to top |
|
 |
Esa |
Posted: Thu Dec 15, 2011 7:31 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
inMo wrote: |
Search the help files for RESIGNAL. Does that meet your req? |
No.
Cannot resignal without a signal.
In this case no exception has been thrown or caught yet. We are downstream from the node that detected the exception situation. There is an ExceptionList tree that represents the signal but it is in a form of a logical message tree and needs to be parsed (back?) into a throwable exception. |
|
Back to top |
|
 |
mgk |
Posted: Thu Dec 15, 2011 7:38 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
So, to do this you need to turn the ExceptionList back into an exception you can throw. The easiest way to do this today is to use the CreateExceptionFromExceptionList method in the new .NET API in V8. Alternatively, you can just throw a new exception that contains tha same information as the original ExceptionList...
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
Esa |
Posted: Thu Dec 15, 2011 7:51 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
mgk wrote: |
So, to do this you need to turn the ExceptionList back into an exception you can throw. The easiest way to do this today is to use the CreateExceptionFromExceptionList method in the new .NET API in V8. |
Nice. Will that be available in the java API as well? Anything else would be unfair
Unfortunately it does not help if you are running 6.1 on AIX...
mgk wrote: |
Alternatively, you can just throw a new exception that contains tha same information as the original ExceptionList...
|
I think I see what you mean. I only need to copy the information from the last Exception in the tree (yes, and that should in fact be the only Exception in the list at that moment) and the rest of the stack will be build automatically as the exception is thrown upstream. That's it. Thanks, Matthew. |
|
Back to top |
|
 |
Esa |
Posted: Fri Dec 16, 2011 1:04 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Esa wrote: |
mgk wrote: |
Alternatively, you can just throw a new exception that contains tha same information as the original ExceptionList...
|
I think I see what you mean. I only need to copy the information from the last Exception in the tree (yes, and that should in fact be the only Exception in the list at that moment) and the rest of the stack will be build automatically as the exception is thrown upstream. |
Actually, this does not solve the problem. What I would like to do is to add my own little nested exception to the exception represented as the ExceptionList and then throw it. The problem is that ESQL THROW only allows you to set exception severity, catalog, number and inserts. Several fields are also lost, including Type, Name and Label.
Sure I can copy the ExceptionList into Environment, throw my exception and rearrange the Exceptionlist in a generic exception handler. That's what I will have to do. But it is not a very sofisticated solution - I would rather throw a self-contained exception package. |
|
Back to top |
|
 |
|