I use Groovy to inject variables into the build process using "EnvInject Plugin" plugin:
https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
My script is saved under "Evaluated Groovy script" text area.
If the script is working, everything is fine. But if some error occurs, I always get the same error message:
[EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: null
Is there any way to get the actual exception or even exception message?
Another solution, that I found is to wrap your code into
try {
// CODE HERE
} catch (Throwable t) {
println(t)
throw t;
}
If you put the script in the 'Prepare an environment for the run' section rather than down at the 'Build Environment' level in 'Inject environment variable to the build process' it will give you the exception error and the stack trace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With