Whenever an exception comes up using *.groovy code to "inject environment variables to the build process", the exception and it´s message/stacktrace is not shown in the console / log:
Only this line can be seen:
The code to reproduce this looks for example just like:
See also the attached file for a sample job.
Please report the exception, so analyzing the problem would be much easier.