[forge-issues] [JBoss JIRA] (FORGE-1970) Copy cause's message to InvocationTargetException

George Gastaldi (JIRA) issues at jboss.org
Mon Aug 11 15:28:29 EDT 2014


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

George Gastaldi updated FORGE-1970:
-----------------------------------

    Fix Version/s: 2.x Future


> Copy cause's message to InvocationTargetException
> -------------------------------------------------
>
>                 Key: FORGE-1970
>                 URL: https://issues.jboss.org/browse/FORGE-1970
>             Project: Forge
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>            Reporter: Ondrej Zizka
>             Fix For: 2.x Future
>
>
> InvocationTargetException
> in arquillian-forge-core appears without any message and with null cause. The cause is in {{target}} property.
> Then the logging frameworks do not show the additional information.
> I suggest to either copy the error to the {{cause}} property, or at least to copy the message.
> I.e. change this in {{org.jboss.forge.arquillian.ForgeTestMethodExecutor}}
> {code}
>                         if (e.getCause() != null && e.getCause() instanceof Exception)
>                            throw (Exception) e.getCause();
>                         else
>                            throw e;
> {code}
> into something like
> {code}
>                       if (e.getCause() != null) {
>                         if( e.getCause() instanceof Exception)
>                            throw (Exception) e.getCause();
>                         else{
>                            e = new InvocationTargetException( target, target.getMessage);
>                            // And some reflection to set the cause.
>                            throw e;
>                         }
>                       }
> {code}
> I would make a PR, but I didn't find where the repo for arq-forge-core is.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the forge-issues mailing list