title: Groovy how to handle failed library import
body: <p>I have a Jenkinsfile that always gets run by two webhooks, one for env A and one for env B.</p>
  
  <p>It is guaranteed to always fail in env A. There is an <code>@Library</code> for a library that does not exist in env A.</p>
  
  <p>The Jenkinsfile runs fine in env B.</p>
  
  <p>Here's what I want:</p>
  
  <pre><code>try {
      @Libray('my-library')
  }
  catch (whatevs) {
      println "whoops, I'm running in the wrong environment! my-library is unavailable."
      System.exit(0)
  }
  </code></pre>
  
  <p>But it doesn't work, it looks like the imports are checked at compile time:</p>
  
  <p><code>
  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  WorkflowScript: Loading libraries failed
  </code></p>
  
  <p>How can I have the script exit with code 0 when the lib isn't available?</p>