mirror of https://github.com/apache/activemq.git
optimisation; if a JMS exception has already been thrown then don't wrap it again
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@356519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab8f458612
commit
262a5596d9
|
@ -38,6 +38,9 @@ final public class JMSExceptionSupport {
|
|||
}
|
||||
|
||||
public static JMSException create(Throwable cause) {
|
||||
if (cause instanceof JMSException) {
|
||||
return (JMSException) cause;
|
||||
}
|
||||
String msg = cause.getMessage();
|
||||
if( msg==null || msg.length()==0 )
|
||||
msg = cause.toString();
|
||||
|
@ -47,6 +50,9 @@ final public class JMSExceptionSupport {
|
|||
}
|
||||
|
||||
public static JMSException create(Exception cause) {
|
||||
if (cause instanceof JMSException) {
|
||||
return (JMSException) cause;
|
||||
}
|
||||
String msg = cause.getMessage();
|
||||
if( msg==null || msg.length()==0 )
|
||||
msg = cause.toString();
|
||||
|
|
Loading…
Reference in New Issue