groovy:
throw new com.pmease.quickbuild.QuickbuildException("Build is failed intentionally!");
When I through an exception from within script step it prints out the whole stack trace that makes it difficult to understand the log.
Is there any way to control what will be printed out to the log or any other way to fail the step execution w/o printing full stack trace to the log?
But when one is troubleshooting build problems it's very inconvenient when log is overwhelmed by irrelevant information.
In this specific case the trace prints out the whole groovy script and claims there is an interpretation error which is confusing.
I think more option to control log behavior may be useful.
I also agree the with the above behaviour.
Its very hard for developers to find the error. We are admin and can check the error but developers need exact information.
Regards,
Satyam.
I just ran across this situation today. I have a step that executes groovy and I want to fail the build in certain situations. The only way I could figure out how to do it was to throw an exception.
I don't like doing that because it logs the call stack and looks like something is horribly wrong with the groovy code or QuickBuild itself.
People see that call stack and immediately assume that something is seriously wrong with QuickBuild or the groovy script.
It would be nice to just give them a message that provides a simple message as to why we purposely failed the build.
I'm thinking something like
step.setStatus(Status.Failed, "Failed because I did not want this step to succeed.")
or
step.fail("Failed because I did not want this step to succeed.")
The log would then look something like
16:24:56,960 INFO - Executing pre-execute action...
16:24:56,960 INFO - Running step...
16:24:56,997 INFO - Checking step execute condition...
16:24:56,998 INFO - Step execute condition satisfied, executing...
16:24:58,027 INFO - Executing pre-execute action...
16:24:58,027 INFO - Running step...
16:24:58,061 ERROR - Failed because I did not want this step to succeed.
16:24:58,086 INFO - Executing post-execute action...