Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1970

Copy cause's message to InvocationTargetException

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Major
    • 2.x Future
    • None
    • None
    • None

    Description

      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

                              if (e.getCause() != null && e.getCause() instanceof Exception)
                                 throw (Exception) e.getCause();
                              else
                                 throw e;
      

      into something like

                            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;
                              }
                            }
      

      I would make a PR, but I didn't find where the repo for arq-forge-core is.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ozizka_jira Ondrej Zizka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: