title: incorrect exitCode in custom script of TeamCity
body: <p>We have a Scala project and we use SBT as its build tool.
  our CI tool is TeamCity, and we build the project using the command line custom script option with the following command: </p>
  
  <pre><code>call %system.SBT_HOME%\bin\sbt clean package
  </code></pre>
  
  <p>The build process works fine when the build succeeds, however, when compilation fails - TeamCity thinks that the script exited with exitCode 0 and not 1 as expected, this cause TeamCity build to succeed although the compilation failed.</p>
  
  <p>when we run the same commands on local cmd we see that the errorLevel is 1.</p>
  
  <p>the relevant part of the build log:</p>
  
  <pre><code>[11:33:44][Step 1/3] [error] trait ConfigurationDomain JsonSupport extends CommonFormats {
  [11:33:44][Step 1/3] [error]                           ^
  [11:33:44][Step 1/3] [error] one error found
  [11:33:45][Step 1/3] [error] (compile:compile) Compilation failed
  [11:33:45][Step 1/3] [error] Total time: 12 s, completed Jan 9, 2014 11:33:45 AM
  [11:33:45][Step 1/3] Process exited with code 0
  </code></pre>
  
  <p>how can we make TeamCity recognize the failure of the build?</p>