I am trying to have the reason as it is printed on the console of my Jenkins instance why a build failed through email. I did the following
try {
.....
} catch (err) {
cause=err
emailext body:"Error: $cause ",
to: 'mye...@gmail.com'
}
The result on the console is something like "dotnetge command not found" and i will like to have this same type of error through email. This is what i get through email
Error: hudson.AbortException: script returned exit code 127