-
-
Save tombruijn/b75dcd6722d67f7a982fddc23f295b02 to your computer and use it in GitHub Desktop.
SystemExit rescue example
This file contains 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
#!/usr/bin/env ruby | |
# $ ruby system.rb | |
loop do | |
begin | |
exit 1 | |
rescue SystemExit => e | |
print "I should exit, but I don't" | |
end | |
print " - " | |
sleep 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment