Jamis Buck points out the not open used "else" clause of the begin end block. Apparently, the begin end clause can have an else in there.
For example:
begin
# Your normal code block
rescue SomeException
# ... handling exception
else
# This part only run if the main code did not throw
# an exception.
ensure
# The very last thing to be run before the clause exit.
# Code in the ensure clause will always get execute.
end
You can read more about this at Jamis Buck blog entry, begin + else.
Subscribe to:
Post Comments (Atom)
2 comments:
"Jamis Buck points out the not open used "else" clause". . .
I believe you mean "often".
Jus' sayin!
Nice job on rescue clause; I always forget how to write them. Thanks
--Richard
Post a Comment