exception.success? Returns true is the exit status if nil or zero.
begin exit(99) rescue SystemExit => e print "This program " if e.success? print "did" else print "did not" end puts " succeed" end