title: Jenkins pipeline not failing based on batch exit code
body: <p>I am having trouble with a Jenkins pipeline that is not failing when a called batch file fails. I have checked the batch file, it returns a non-zero status code, but somehow this seems to be not considered. Does anyone of you have a hint for me?</p>
  
  <p>desired pipeline</p>
  
  <pre><code>node {
    stage('1'){
      dir('_src') {
        bat 'call test.bat'
      }
    }
  }
  </code></pre>
  
  <p>Calling the batch in cmd window results in the following</p>
  
  <pre><code>&gt;call test.bat
  INFO: Started ...
  ERROR
  Press any key to continue . . . 
  &gt;echo %ERRORLEVEL%
  2
  </code></pre>
  
  <p>I also used the following pipeline for testing</p>
  
  <pre><code>node {
    stage('1'){
      dir('_src') {
        bat '''call test.bat
        echo %ERRORLEVEL%'''
      }
    }
  }
  </code></pre>
  
  <p>... with this output</p>
  
  <pre><code>C:\_src&gt;call test.bat 
  INFO: Started ...
  ERROR
  Press any key to continue . . . 
  2
  </code></pre>
  
  <p>Still, the pipeline is not failing. Any ideas?</p>