Unable to see inputAssembly.ExceptionList.RootElement contents

Using C# .Net. I am trying to get the contents of the exception listed into a String in a .Net compute node. I am 100% sure that exceptions exist; however, when I try to do the following I can't get a list of the exceptions.

I also tried with the trace node, but the problem I have with that is the fact that trace spits it out in some code number manner. by doing the below I was hoping I can get the XML representation, so that I can parse out what I need from the xml structure

1 reply

Unfortunately Exceptions in the ExceptionList tree are not owned by an owning parser. That means an asBitstream() cannot serialize them into a bitstream form.

If you use something like getValue(), it will just return the value of the element that NbElement is referring to. Because this is just a generic tree it has no concept of a "wire format" such as XML built in to it.

If you want to serialized it as XML then you would need to copy the ExceptionList to a new element owned by the XMLNSC tree parser and then serialize that.

Alternatively, you would have to traverse the tree extracting the parts they want and manually building an output bitstream from it.

You might also need to serialize the exception first, which implies you the use of ESQL to acomplish that.

With this said, you should then be able to read all the exceptions with the .Net code.