title: How to mark Jenkins builds as SUCCESS only on specific error exit values (other than 0)?
body: <p>When I run an <code>Execute shell</code> build step to execute a script and that script returns <code>0</code>, <code>Jenkins</code> flags the build as <code>SUCCESS</code>, otherwise it flags it as <code>FAILURE</code> which is the expected default behaviour as <code>0</code> means no errors and any other value represents an error.</p>
  
  <p><strong>Is there a way to mark a build as <code>SUCCESS</code> only if the return value matches a specific value other than <code>0</code> (e.g. <code>1</code>,<code>2</code>,<code>3</code>...)?</strong></p>
  
  <p><em>PS: in case you're wondering why I'm looking for that, this will allow me to perform unit testing of Jenkins itself as my scripts are written to return different exit values depending on various factors, thus allowing me to expect certain values depending on certain setup mistakes and making sure my whole Jenkins integration picks up on those.</em></p>