title: Jenkins pipeline check website availability issue
body: <p>Can anyone hint me - what is wrong with this step? I need to check, that application is deployed and website is up^</p>
  
  <pre><code>stage('Check Availability') {
    agent any
    steps {             
      timeout(time: 15, unit: 'SECONDS') {
        waitUntil {
          try {         
            sh "curl -s --head  --request GET  localhost:8081/actuator/health | grep '200'"
                return true
            } catch (Exception e) {
              return false
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>But I cannot understand what is wrong with groovy syntax. Right now I receive error.</p>
  
  <pre><code>WorkflowScript: 50: Expected a step @ line 50, column 15.
  try {
  ^
  </code></pre>
  
  <p><a href="http://prntscr.com/jdycje" rel="nofollow noreferrer">http://prntscr.com/jdycje</a></p>