[jboss-jira] [JBoss JIRA] (LOGTOOL-31) Allow exception methods to set fields on the exception object

James Perkins (Closed) (JIRA) jira-events at lists.jboss.org
Wed Oct 19 18:35:46 EDT 2011


     [ https://issues.jboss.org/browse/LOGTOOL-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Perkins closed LOGTOOL-31.
--------------------------------


    
> Allow exception methods to set fields on the exception object
> -------------------------------------------------------------
>
>                 Key: LOGTOOL-31
>                 URL: https://issues.jboss.org/browse/LOGTOOL-31
>             Project: Log Tool
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>            Reporter: David Lloyd
>            Assignee: James Perkins
>             Fix For: 1.0.0.CR3
>
>
> Create a new annotation called @Field which accepts a single string parameter.  For methods which return an exception, the values of these parameters will be assigned to fields on the exception object with the corresponding name.
> For example:
> {code}
> @Message(id = 1000, "The transaction failed because blah blah %s")
> XAException transactionFailedBlah(String blah, @Field("errorCode") int errorCode);
> // should also continue to work with @Cause in conjunction with exceptions which don't have a cause param:
> @Message(id = 1001, "The operation was interrupted unexpectedly by %s")
> InterruptedIOException surprise(String reason, @Cause Throwable someCause, @Field("bytesTransferred") int bytesTransferred);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list