title: Jenkins timeout/abort exception
body: <p>We have a Jenkins pipeline script that requests approval from the user after all the preparatory steps are complete, before it actually applies the changes.</p>
  
  <p>We want to add a timeout to this step, so that if there is no input from the user then the build is aborted, and are currently working on using this kind of method: </p>
  
  <pre><code>    try {
        timeout(time: 30, unit: 'SECONDS') {
          userInput = input("Apply changes?")
        }
      } catch(err) {
        def user = err.getCauses()[0].getUser()
  
        if (user.toString == 'SYSTEM') {  // if it's system it's a timeout
          didTimeout = true
          echo "Build timed out at approval step"
        } else if (userInput == false) {  // if not and input is false it's the user
          echo "Build aborted by: [${user}]"
        }
      }
  </code></pre>
  
  <p>This code is based on examples found here: <a href="https://support.cloudbees.com/hc/en-us/articles/226554067-Pipeline-How-to-add-an-input-step-with-timeout-that-continues-if-timeout-is-reached-using-a-default-value" rel="noreferrer">https://support.cloudbees.com/hc/en-us/articles/226554067-Pipeline-How-to-add-an-input-step-with-timeout-that-continues-if-timeout-is-reached-using-a-default-value</a> and other places online, but I really dislike catching <em>all</em> errors then working out what's caused the exception using <code>err.getCauses()[0].getUser()</code>. I'd rather explicitly <code>catch(TimeoutException)</code> or something like that.</p>
  
  <p>So my question is, what are the actual exceptions that would be thrown by either the approval step timing out or the userInput being false? I haven't been able to find anything in the docs or Jenkins codebase so far about this.</p>