cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject SAX bugfix for displaying detailed XML parsing errors
Date Tue, 07 Nov 2000 18:21:48 GMT
Due to a bug in org.xml.sax.SAXException.toString(), and the fact that 
java.lang.Throwable.printStackTrace() calls toString in at least some JVMs, 
detail messages can be lost.

The following patch fixes the bug. Users of SAX parsers such as Xerces can 
use it by simply adding the attached sax-bugfix.jar to their CLASSPATH, 
before the jar of the parser.

    /**
     * Override toString to pick up any embedded exception.
     *
     * @return A string representation of this exception.
     */
    public String toString ()
    {
        if (exception != null) {
            return super.toString () + " (nested exception: " + 
exception.toString() + " )";
        } else {
            return super.toString();
        }
    }



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message