Jenkins Pipeline Plugin : how to print stacktrace in a try/catch

5,623 views
Skip to first unread message

Nicolas Geraud

unread,
Mar 27, 2016, 2:49:02 PM3/27/16
to Jenkins Users
Hi,

i want to add a try/catch/finaly block in my pipeline script.

try {
println(" Release ${components.size()} components in parallel : ${componentListToPrint} \n")
parallel parallelBuild
} catch(err) {
echo "Exception thrown:\n ${err}"
echo "Stacktrace:"
err.printStackTrace()
currentBuild.result = 'FAILURE'
} finally {
return componentsReleased
}


The problem is that i'm not able to print the complete stacktrace (the stasktrace is essential for debugging purpose).

The question is : how to print the complete stacktrace as if there were no try / catch block ?
Reply all
Reply to author
Forward
0 new messages