ITeye博客

ruby 异常处理

rloc2003 · 2011-05-25 10:19 · ruby · 编程语言 · Ruby · .net · F# · Markdown

f = File.open("testfile")

begin

# .. process

rescue     //获取异常

# .. handle error

ensure     //异常处理

f.close unless f.nil?

end

 

原文http://my4java.itpub.net/post/9983/63710

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。