struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deadman, Hal" <>
Subject digester parse error handling
Date Thu, 29 Mar 2001 18:33:45 GMT
I was surprised to see that the Digester ignores parsing errors by
overriding fatalError(), error() and warning() and just logging the parse
exception without re-throwing it. The default behavior for the HandlerBase
fatalError() method is to re-throw the exception so it seems like Digester
should re-throw it after it logs it. At first I thought extending Digester
would allow me to work around this problem but Digester is declared to be
final. Is there any way to know that a parsing error occurred after calling
Digester.parse()? I think the Digester should re-throw exceptions in at
least fatalError() and it should not be a final class. Let me know if I am
missing something.

    public void fatalError(SAXParseException exception) throws SAXException

	log("Parse Fatal Error at line " + exception.getLineNumber() +
	    " column " + exception.getColumnNumber() + ": " +
	    exception.getMessage(), exception);


View raw message