title: Ruby begin rescue end with if-then-else
body: <p>I am kind of stuck with using begin-rescue-end with if-else-end. Please see the code snippet below.</p>
  
  <pre><code>def fn1
      unless fn2?
          puts "Message 1"
          return
      end
  
      puts "Message 2"
  end
  
  def fn2?
      begin
          &lt;do action&gt;
      rescue
          &lt;handle error here&gt;
          puts "Message 3"
          return
      end
  
      if &lt;condition&gt;
          puts "Message 4"
          return true
      else
          puts "Message 5"
          return false
      end
  end
  </code></pre>
  
  <p>In the begin block, if there is no exception raised, then if-else will get executed and return true or false to fn1. No problem with this.</p>
  
  <p>But in the begin block, should an exception be raised, I want to just print "Message 3" and end the program, without printing "Message 1".</p>
  
  <p>Any pointers please. Thanks.</p>