Petals CDK

The method Exchange#setError( Exception ) is painful

Details

  • Type: Improvement Request Improvement Request
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 5.1
  • Fix Version/s: 5.1.1
  • Component/s: Utils
  • Security Level: Public
  • Description:
    Hide

    Because of the Java doc of this method, completed by the wiki, I think this method should be changed, by raising the limitation on the exception type

    Keep MessageExchange#setError( Exception ), as stated by the JBI specification.
    And implement Exchange#setError( Exception ) with:

    if (exception instanceof MessagingException 
                || ename.startsWith("java.")
                || ename.startsWith("org.w3c.")
                || ename.startsWith("org.xml.")) {
         exchange.setError(exception);
    
    } else {
         MessagingException msgException = new MessagingException(ExceptionUtil
                  .getExtendedMessage(exception));
         exchange.setError(msgException);
    }

    That would be useful in the developer kit.

    Show
    Because of the Java doc of this method, completed by the wiki, I think this method should be changed, by raising the limitation on the exception type Keep MessageExchange#setError( Exception ), as stated by the JBI specification. And implement Exchange#setError( Exception ) with:
    if (exception instanceof MessagingException 
                || ename.startsWith("java.")
                || ename.startsWith("org.w3c.")
                || ename.startsWith("org.xml.")) {
         exchange.setError(exception);
    
    } else {
         MessagingException msgException = new MessagingException(ExceptionUtil
                  .getExtendedMessage(exception));
         exchange.setError(msgException);
    }
    That would be useful in the developer kit.
  • Environment:
    All.

Activity

Roland Naudin made changes - Fri, 22 Oct 2010 - 09:38:25 +0200
Field Original Value New Value
Status New [ 10000 ] Open [ 10002 ]
Priority Minor [ 4 ]
Hide
Roland Naudin added a comment - Fri, 22 Oct 2010 - 09:38:32 +0200

great idea

Show
Roland Naudin added a comment - Fri, 22 Oct 2010 - 09:38:32 +0200 great idea
Vincent Zurczak made changes - Fri, 22 Oct 2010 - 16:29:56 +0200
Description According to the Java doc of this method, and completed by [the wiki|http://doc.petalslink.com/display/petalsesb30/Advanced+topics+and+guidelines#Advancedtopicsandguidelines-Theproblematic], this method should be changed, by raising the limitation on the exception type

Keep MessageExchange#setError( Exception ), as stated by the JBI specification.
And implement Exchange#setError( Exception ) with:

{code:lang=java}
if (exception instanceof MessagingException
            || ename.startsWith("java.")
            || ename.startsWith("org.w3c.")
            || ename.startsWith("org.xml.")) {
     exchange.setError(exception);

} else {
     MessagingException msgException = new MessagingException(ExceptionUtil
              .getExtendedMessage(exception));
     exchange.setError(msgException);
}
{code}

That would be useful in the developer kit. ;)
Because of the Java doc of this method, completed by [the wiki|http://doc.petalslink.com/display/petalsesb30/Advanced+topics+and+guidelines#Advancedtopicsandguidelines-Theproblematic], I think this method should be changed, by raising the limitation on the exception type

Keep MessageExchange#setError( Exception ), as stated by the JBI specification.
And implement Exchange#setError( Exception ) with:

{code:lang=java}
if (exception instanceof MessagingException
            || ename.startsWith("java.")
            || ename.startsWith("org.w3c.")
            || ename.startsWith("org.xml.")) {
     exchange.setError(exception);

} else {
     MessagingException msgException = new MessagingException(ExceptionUtil
              .getExtendedMessage(exception));
     exchange.setError(msgException);
}
{code}

That would be useful in the developer kit. ;)
Mathieu Carrolle made changes - Wed, 27 Oct 2010 - 11:14:11 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Mathieu Carrolle made changes - Wed, 27 Oct 2010 - 11:21:34 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Fix Version/s 5.1.1 [ 10152 ]
Resolution Fixed [ 1 ]
Mathieu Carrolle made changes - Wed, 27 Oct 2010 - 11:21:41 +0200
Status Resolved [ 10004 ] Closed [ 10005 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
13h 26m
1
Roland Naudin
Fri, 22 Oct 2010 - 09:38:25 +0200
Open Open In Progress In Progress
5d 1h 35m
1
Mathieu Carrolle
Wed, 27 Oct 2010 - 11:14:11 +0200
In Progress In Progress Resolved Resolved
7m 23s
1
Mathieu Carrolle
Wed, 27 Oct 2010 - 11:21:34 +0200
Resolved Resolved Closed Closed
7s
1
Mathieu Carrolle
Wed, 27 Oct 2010 - 11:21:41 +0200



People

Dates

  • Created:
    Thu, 21 Oct 2010 - 20:12:20 +0200
    Updated:
    Wed, 27 Oct 2010 - 11:21:41 +0200
    Resolved:
    Wed, 27 Oct 2010 - 11:21:34 +0200