title: Output of variable content in "catch" exception block in Jenkins Groovy DSL pipeline
body: <p>I have the next workable part of code in my <code>Jenkins</code> pipeline:</p>
  
  <pre><code>saltnodes.each {
          node('slave1') {
              stage('Salt call') {
                  saltresult = salt authtype: 'pam', clientInterface: runner(
                          function: 'state.orch', mods: 'test.deploy', pillarvalue: "$someParams"),
                          credentialsId: 'mycreds', servername: "http://$it"
                  println JsonOutput.prettyPrint(saltresult)
              }
          }
  </code></pre>
  
  <p>In this part of code I am trying to implement <code>"try"</code> and <code>"catch"</code> exception handler:</p>
  
  <pre><code>import groovy.transform.Field
  
  saltnodes.each {
          node('slave1') {
              stage('Salt call') {
                try{
                  @Field result = salt authtype: 'pam', clientInterface: runner(
                          function: 'state.orch', mods: 'test.deploy', pillarvalue: "$someParams"),
                          credentialsId: 'mycreds', servername: "http://$it"
                    }
                catch (e){
                    def jsonSlurper = new JsonSlurper()
                    println jsonSlurper.parseText(result)
              }
          }
  </code></pre>
  
  <p>But when I use <code>@Filed</code> transformation here, I get <code>"Null pointer exception"</code> </p>
  
  <p>How else can I pass <code>"result"</code> variable to <code>"catch"</code> block in order to print content of result variable there? </p>