Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
Handling Exceptions: 10 / 0 : rescue « Statement « Ruby
Ruby
Statement
rescue
Handling Exceptions: 10 / 0
begin puts 10 / 0 rescue puts
"You caused an error!"
end
Related examples in the same category
1.
rescue's syntax makes handling different exceptions in different ways easy:
2.
C++, Java, and Ruby exception handling compared
3.
how exceptions work in Ruby.
4.
Handling Passed Exceptions
5.
begin