Skip to content

Instantly share code, notes, and snippets.

@tombruijn
Created October 11, 2016 12:03
Show Gist options
  • Save tombruijn/b75dcd6722d67f7a982fddc23f295b02 to your computer and use it in GitHub Desktop.
Save tombruijn/b75dcd6722d67f7a982fddc23f295b02 to your computer and use it in GitHub Desktop.
SystemExit rescue example
#!/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