tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54802] Provide location information for exceptions thrown by JspDocumentParser
Date Fri, 05 Apr 2013 15:10:56 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54802

--- Comment #3 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
Created attachment 30157
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30157&action=edit
2013-04-05_tc8_54802_1.patch

A patch that improves information shown by error page and logged.

> but at least it will provide the name of the file

First, the above assumption is actually incorrect. A locator does not provide
the file name. It knows line and column numbers only  (and systemId, publicId
of the resource).

The name was provided by  catch(SAXParseException) clause  at
JspDocumentParser.parse(JspDocumentParser.java:205)

Still, I would say that line numbers are useful.


Second, the original exception was lost in the same place
(JspDocumentParser.java:205). It is easy to fix by adding a new method to
jasper.compiler.DefaultErrorHandler. See the patch.

Third, the logging is done in StandardWrapper.invoke(). It logged only the
innermost exception in ex.getCause() chain. I am saying that it is wrong as
 1. A usual rule is that outer exceptions provide additional contextual
information.
 2. The error page shows the full exception chain. Omitting it in the log
message is inconsistent and leaves administrator without a clue.


Though one of my assumptions was wrong, as I mention above, I plan to leave
r1464781 as is and go on with changes outlined in this patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message