The statement I make in the subject doesn't make sense, but I don't know 
how else to describe it.

I'm working on a set of builds using scripted pipelines.  Our Jenkinsfiles 
are very short, all of the build logic is in the shared library.  In the 
"main" shared library function, I'm trying to call another function defined 
in another "vars" class.  We have many of these already.  In this called 
function, I have a call to the "writeFile" pipeline step to create a 
temporary file used by a shell script called immediately after that.  This 
is the only place anywhere in our builds that we call "writeFile".

When I run the build, I get this very unhelpful message:

Jenkins Job Failed due to Exception : org.codehaus.groovy.control.ErrorCollector


There is literally no other information provided, except for the log lines 
that come before it.  I found that an echo statement that is called before 
this suspect function is called is emitted in the log.  An echo statement 
as the first line of the "call()" method of the function being called is 
NOT emitted in the log. Somehow the act of calling the function makes it 
die, with no explanation.

So, I tried a workaround.  In the calling script file, I added a "def" at 
the end of the file, to define an "inline function" with almost the same 
name as the "vars" function name.  I copied the entire body of the "call()" 
method of the vars function into that inline function.  I replaced the call 
to the vars function with the call to the inline function.  It worked on 
the first try.

Any ideas what might cause this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3119e9f3-e6a8-4fa6-861a-76c9358ab300%40googlegroups.com.

Reply via email to