exception.success? Returns true is the exit status if nil or zero. : Exception « Development « Ruby






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 

 








Related examples in the same category

1.Exceprtion hierarchy
2.status fo an exception
3.exc.to_s Returns the message associated with this exception