Guest User

Untitled

a guest
Jun 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # begin is just in common decency
  2. begin
  3. # Explicit exception call
  4. raise "A runtime error"
  5.  
  6. # Catching exception with optional wrapper ( "=> e" is not required)
  7. rescue RuntimeError => e
  8. # Processing error
  9. puts "There was runtime error: #{e}"
  10.  
  11. # Optional ensure block will be executed in any case
  12. ensure
  13. puts "Still alive!!!"
  14. end
Add Comment
Please, Sign In to add comment