title: How to pass error message from batch file to team city
body: <p>I am executing a batch file inside team city build step. batch file has this code.</p>
  
  <pre class="lang-bat prettyprint-override"><code>if errorlevel NEQ 0 (
          echo ##teamcity[message text='failed' errorDetails='' status='ERROR']
          exit 1
  )
  </code></pre>
  
  <p>%errorlevel% just provides error level. How can I get error message so that I can pass that to team city message service.</p>