Abort instead of exit in Ruby
1 min read rubyAre you familiar with this code?
if error?
puts "Sorry, error occured..."
exit 1
end
Just replace that with:
abort "Sorry, error occured..." if error?
Simple and beautiful.
Last modified: 17-Dec-24