On Mar 26, 2007, at 6:39 PM, Helge Hartmann wrote:


I try to get the type of the excetion with this code snippet:
        ...
                } catch (JessException e) {
                        Throwable th = e.getCause();
                        if(th instanceof SAXParseException) {

But every time a JessException is thrown, the getCause method returns null.


Hmmm, yes. OK, looking at your example error, I realize that's not an XML parsing error, but a semantic error in the rule; it's a problem with the rule being compiled, after the parsing is all done, and the rule compiler doesn't know anything about the source code at that point, XML or otherwise. In this particular case, if you try a Jess version of the same rule, you'll note that the rule compiler won't report a line number and column for this error then, either; it will just tell you the name of the variable and show you the code for the whole rule.

I can imagine other cases where the error might be able to include this information, but currently doesn't; I'll have a look. Meanwhile, what I said will hold true for gross syntax errors and that majority of semantic errors that will actually be captured by the XML parser.


---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to