Message:
The following issue has been closed.
Resolver: Max Rydahl Andersen
Date: Mon, 27 Oct 2003 2:58 PM
closing this ;)
(and just to elaborate - chaining exceptions is A Good Thing ;),
and that is what Nestable exceptions bring to the table - right ?
So, if you need some mechanism for "marking" Exceptions as "wrapping-only" then it should be done via some other stuff - eg. a WrapperOnly Marking interface ...but then again - that also got problems ;)
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-424
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-424
Summary: Exception wrappers should not add a message
Type: Patch
Status: Closed
Priority: Minor
Resolution: WON'T FIX
Project: Hibernate2
Components:
core
Versions:
2.1 beta 4
Assignee:
Reporter: John Kristian
Created: Thu, 23 Oct 2003 7:39 PM
Updated: Mon, 27 Oct 2003 2:58 PM
Description:
The attached patch would be an improvement, from my point of view.
Exception classes that merely wrap another exception should not add anything to the message. One reason is to simplify the implementation of code like this, which aims to remove such wrappers:
if (t instanceof Nestable || t instanceof InvocationTargetException || t instanceof UndeclaredThrowableException) {
cause = t.getCause();
if (cause != null) {
String message = t.getMessage();
if (message != null && message.length() > 0
&& ! message.equals(cause.getMessage()))
{
return t;
}
}
} else if (t instanceof etc...
Such code need not require special cases for Hibernate exceptions, if they refrain from adding to the message (as in the attached patch).
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|