Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53143

EnvInject converts all exception types into EnvInjectException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • envinject-plugin
    • None

      When running an EnvInject wrapper script, the EnvInject plugin seems to catch all  exception types, turning them into EnvInject exceptions.  I'd prefer to be able to raise a hudson.AbortException, to abort a job cleanly.

       

      https://github.com/jenkinsci/envinject-plugin/blob/f7e90cd296fb730666ea11bc581c10434d2dd37e/src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectEnvVars.java#L231

       
      ERROR: SEVERE ERROR occurs
      org.jenkinsci.lib.envinject.EnvInjectException: Failed to evaluate the script
      at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.executeGroovyScript(EnvInjectEnvVars.java:232)
      at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentJobPropertyObject(EnvInjectListener.java:187)
      at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:49)
      at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
      at hudson.model.Run.execute(Run.java:1815)
      at hudson.matrix.MatrixBuild.run(MatrixBuild.java:323)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Caused by: hudson.AbortException: CUSTOM ABORT MESSAGE HERE
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
      at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
      at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:200)
      at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:42)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:146)
      at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:197)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:202)
      at org.kohsuke.groovy.sandbox.impl.Checker$checkedConstructor$3.callStatic(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
      at Script1.run(Script1.groovy:108)
       

            Unassigned Unassigned
            danagoyette Dana Goyette
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: