You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by "Ricky Frost (JIRA)" <ws...@ws.apache.org> on 2004/11/12 19:44:23 UTC
[jira] Created: (WSRP4J-42) exception.WSRPException loses the cause of the problem in standard exception processing
exception.WSRPException loses the cause of the problem in standard exception processing
---------------------------------------------------------------------------------------
Key: WSRP4J-42
URL: http://nagoya.apache.org/jira/browse/WSRP4J-42
Project: WSRP4J
Type: Improvement
Components: Other
Versions: current (nightly)
Environment: Tomcat 4.1.30, Win XP, etc
Reporter: Ricky Frost
As a simplified illustration our code has an error handling system that uses the following style:
catch( Exception x )
{
// If the portlet failed, show a "support friendly" display...
for( Throwable cause = x; cause != null; cause = x.getCause() )
markup = markup + "<br/>"+cause.toString();
}
The above code doesn't work when a WSRPException is thrown, even though the original exception is passed in to the WSRPException constructor.
My suggestion is to make the code change as shown below:
Before:
public WSRPException(int errorCode, Throwable t)
{
//String message = Messages.get(errorCode);
super(Messages.get(errorCode));
errCode = errorCode;
nestedThrowable = t;
}
After:
public WSRPException(int errorCode, Throwable t)
{
//String message = Messages.get(errorCode);
super(Messages.get(errorCode), t); // pass in the cause otherwise it's lost
errCode = errorCode;
nestedThrowable = t;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Resolved: (WSRP4J-42) exception.WSRPException loses the cause of the problem in standard exception processing
Posted by "Julie MacNaught (JIRA)" <ws...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/WSRP4J-42?page=history ]
Julie MacNaught resolved WSRP4J-42:
-----------------------------------
Assign To: Julie MacNaught
Resolution: Fixed
Fix Version: current (nightly)
> exception.WSRPException loses the cause of the problem in standard exception processing
> ---------------------------------------------------------------------------------------
>
> Key: WSRP4J-42
> URL: http://issues.apache.org/jira/browse/WSRP4J-42
> Project: WSRP4J
> Type: Improvement
> Components: Other
> Versions: current (nightly)
> Environment: Tomcat 4.1.30, Win XP, etc
> Reporter: Ricky Frost
> Assignee: Julie MacNaught
> Fix For: current (nightly)
>
> As a simplified illustration our code has an error handling system that uses the following style:
> catch( Exception x )
> {
> // If the portlet failed, show a "support friendly" display...
> for( Throwable cause = x; cause != null; cause = x.getCause() )
> markup = markup + "<br/>"+cause.toString();
> }
> The above code doesn't work when a WSRPException is thrown, even though the original exception is passed in to the WSRPException constructor.
> My suggestion is to make the code change as shown below:
> Before:
> public WSRPException(int errorCode, Throwable t)
> {
> //String message = Messages.get(errorCode);
> super(Messages.get(errorCode));
> errCode = errorCode;
> nestedThrowable = t;
> }
> After:
> public WSRPException(int errorCode, Throwable t)
> {
> //String message = Messages.get(errorCode);
> super(Messages.get(errorCode), t); // pass in the cause otherwise it's lost
> errCode = errorCode;
> nestedThrowable = t;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira