I think Alan Moore wrote: > > See manual section 4.1 re: getNextException() -- Jess is telling you > > that it called a Java method via reflection, and it threw an > > exception. You have to call getNextException.printStackTrace() to see > > it -- it will probably give you a clue! > > Would it be more appropriate for Jess to throw an InvocationTargetException, > or an exception deried from it, instead? Jess must be trapping this > exception internally (I don't have the source handy) and then copying > getTargetException() into setNextException(). What is the reason for doing > this? Just curious...
Just that it's nice to have things in the Jess library just throw the one kind of exception (or at least, a group that all extend on type.) If something like "get" could throw InvocationTargetException, then so would virtually everything in Jess's public API: executeCommand(), run(), reset(). assert(). retract()... could all potentially call get(), and so could throw this exception. > > I suspect that it may be too late to change this behavior since many people > already rely on the current exception. One change that I *am* making, slowly: in JDK 1.4, Throwable has a getCause() method, analagous in function to getNextException() -- i.e., any Java exception can have a "root cause" exception attached. In recent Jess 6.1 alphas, you'll notice that JessException has a getCause() that is an alias for getNextException(), and in the near future, getNextException() will be deprecated. This is nice, because all the different JDK exceptions that "chain" this way will be handled uniformly and JessException will fit right in. > alan > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [EMAIL PROTECTED] PO Box 969 http://herzberg.ca.sandia.gov Livermore, CA 94550 -------------------------------------------------------------------- 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] --------------------------------------------------------------------
