DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13279>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13279

Getting InsertTag not to swallow exceptions





------- Additional Comments From [EMAIL PROTECTED]  2003-01-27 16:04 -------
I have looked at the current code and it still fails to propigate any 
exceptions that it catches when it does doInclude() on the JSP. Look at the 
code in processException() and tell me this is an enchancement request and not 
a bug. 

Any exceptions thrown by the included resource are trapped and passed to 
processException(). The bugs in processException() are as follows:

* The exception thrown by the included resource is logged via commons-logging 
but only if debug is enabled. Why not log it with a severity of error? The 
insert tag is rather presumptious to assume that the exception only warrants 
debug. 

* If debug is enabled, not only is the messaged logged to the log file, but the 
entire stack trace is sent to the user as part of the JSP output stream. So in 
order to know about any errors via the logfile, the stack trace must also be 
sent to the user.

* If debug is not enabled, the message, without the stack trace is sent to the 
user, but nothing is logged via commons-logging. Why is the InsertTag taking it 
upon itself to inform the user of the error? Shouldn't the application 
developer have a chance to deal with the error?  

The only way that processException will re-throw any exception is if it fails 
to write the message to the JSP output stream. 

The Insert tag has an "ignore" attribute which instructs it whether to ignore 
errors or not, but this is not used for all types of errors, and as far as I am 
concerned, the tag ignores all errors whether the ignore attribute is set or 
not. 

The tag probably needs to re-throw JspException. I don't know if the version of 
JSPException that allows nested exceptions is available in the JSP version that 
Struts supports. Logging the real exception via commons-logging with a severity 
of "error" and re-throwing any exception would be sufficient for now. 

Maybe the ignore attribute could be used to determine whether or not to re-
throw exceptions. The default for ignore could probably be changed to "true" 
since the tag more or less ignores exceptions anyway. That would acheive some 
degree of backwards compatability. Then again, it might be safer to use a new 
attribute.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to