Update of /cvsroot/displaytag/display09/src/org/displaytag/exception
In directory sc8-pr-cvs1:/tmp/cvs-serv15012/src/org/displaytag/exception
Modified Files:
BaseNestableJspTagException.java
Log Message:
reverting back to previous version. Exception MUST be logged at contructor and not at
printStackTrace. Logging at printStackTrace does not assure exception is logged if
catched
Index: BaseNestableJspTagException.java
===================================================================
RCS file:
/cvsroot/displaytag/display09/src/org/displaytag/exception/BaseNestableJspTagException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BaseNestableJspTagException.java 9 Jul 2003 12:59:49 -0000 1.3
--- BaseNestableJspTagException.java 15 Jul 2003 21:53:16 -0000 1.4
***************
*** 8,16 ****
/**
* <p>Base exception: extendes JspTagException providing loggin and exception
nesting functionalities</p>
! * @author fgiust
* @version $Revision$ ($Author$)
*/
public abstract class BaseNestableJspTagException extends JspTagException
{
/**
* Class where the exception has been generated
--- 8,17 ----
/**
* <p>Base exception: extendes JspTagException providing loggin and exception
nesting functionalities</p>
! * @author fgiust
* @version $Revision$ ($Author$)
*/
public abstract class BaseNestableJspTagException extends JspTagException
{
+
/**
* Class where the exception has been generated
***************
*** 32,35 ****
--- 33,60 ----
super(pMessage);
mSourceClass = pSourceClass;
+
+ // log exception
+ Log lLog = LogFactory.getLog(pSourceClass);
+ lLog.error(toString());
+
+ // choose appropriate logging method
+ if (getSeverity() == SeverityEnum.DEBUG)
+ {
+ lLog.debug(toString());
+ }
+ else if (getSeverity() == SeverityEnum.INFO)
+ {
+ lLog.info(toString());
+ }
+ else if (getSeverity() == SeverityEnum.WARN)
+ {
+ lLog.warn(toString());
+ }
+ else
+ {
+ // error - default
+ lLog.error(toString());
+ }
+
}
***************
*** 45,83 ****
mSourceClass = pSourceClass;
mCause = pCause;
- }
! /**
! * returns the previous exception
! * @return Throwable previous exception
! */
! public Throwable getCause()
! {
! return mCause;
! }
!
! public void printStackTrace() {
! // log exception
! Log lLog = LogFactory.getLog(mSourceClass);
! lLog.error(toString());
// choose appropriate logging method
if (getSeverity() == SeverityEnum.DEBUG)
{
! lLog.debug(toString());
}
else if (getSeverity() == SeverityEnum.INFO)
{
! lLog.info(toString());
}
else if (getSeverity() == SeverityEnum.WARN)
{
! lLog.warn(toString());
}
else
{
// error - default
! lLog.error(toString());
}
! }
/**
--- 70,106 ----
mSourceClass = pSourceClass;
mCause = pCause;
! // log exception
! Log lLog = LogFactory.getLog(pSourceClass);
// choose appropriate logging method
if (getSeverity() == SeverityEnum.DEBUG)
{
! lLog.debug(toString(), pCause);
}
else if (getSeverity() == SeverityEnum.INFO)
{
! lLog.info(toString(), pCause);
}
else if (getSeverity() == SeverityEnum.WARN)
{
! lLog.warn(toString(), pCause);
}
else
{
// error - default
! lLog.error(toString(), pCause);
}
!
! }
!
! /**
! * returns the previous exception
! * @return Throwable previous exception
! */
! public Throwable getCause()
! {
! return mCause;
! }
/**
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel