title: How to tell whether job failed or was aborted
body: <p>I've got a Jenkins job with a <code>try..catch</code> structure:</p>
  
  <pre><code>try
  {
    [do work here]
  }
  catch(err)
  {
  }
  </code></pre>
  
  <p>Is there any way, from inside the <code>catch</code> block, that I can tell whether the build failed or was aborted by the user?</p>
  
  <p>I've tried looking at <code>err.getMessage()</code>, <code>err.getCause()</code>, <code>err.toString()</code>, and <code>currentBuild.result</code>, but none of them consistently tell me whether it failed or was aborted.</p>