exc.to_s Returns the message associated with this exception : Exception « Development « Ruby






exc.to_s Returns the message associated with this exception


begin
    raise "The message"
rescue Exception => e
    puts e.to_s
end 

 








Related examples in the same category

1.Exceprtion hierarchy
2.status fo an exception
3.exception.success? Returns true is the exit status if nil or zero.