#23 Better Stacktrace handling in SAXExcepti

open
nobody
None
5
2002-09-11
2002-09-11
Anonymous
No

The current SAXException does not show the stack
trace of the wrapped exception, but it shows the
message if it.
By adding the following lines, the stacktrace is also
shown and helps in debugging a lot:

public void printStackTrace() {
super.printStackTrace();
if(exception!=null)
exception.printStackTrace();
}

public void printStackTrace( PrintStream s ) {
super.printStackTrace(s);
if(exception!=null)
exception.printStackTrace(s);
}

public void printStackTrace( PrintWriter s ) {
super.printStackTrace(s);
if(exception!=null)
exception.printStackTrace(s);
}

Discussion

  • David Brownell
    David Brownell
    2002-10-31

    Logged In: YES
    user_id=44117

    odd, I've certainly seen multiple stack traces. But the
    real fix
    is to make this work like the JDK 1.4 does; it taught
    "Exception"
    how to wrap exceptions.

     
  • Logged In: NO

    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax
    sax