ruby 异常处理
f = File.open("testfile")
begin
# .. process
rescue //获取异常
# .. handle error
ensure //异常处理
f.close unless f.nil?
end
f = File.open("testfile")
begin
# .. process
rescue //获取异常
# .. handle error
ensure //异常处理
f.close unless f.nil?
end
暂无评论。
评论功能维护中,当前仅展示历史评论。