Created
October 3, 2011 06:04
-
-
Save julioterra/1258532 to your computer and use it in GitHub Desktop.
exception rescue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin | |
| x = 5 | |
| if x < 10 then raise ArgumentError, "exception raised #{x} is too small" end | |
| rescue ArgumentError | |
| puts "exception rescued, but #{x} is still too small" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment