Last active
December 11, 2015 19:08
-
-
Save tigawa/4645982 to your computer and use it in GitHub Desktop.
ruby 例外処理
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
content = load_blog_data(file_name) | |
rescue BlogDataNotFound | |
STDERR.puts "ファイル#(file_name}がみつかりません" | |
rescue BlogDataFormatError | |
STDERR.puts "#{file_name}内のブログデータが壊れています" | |
rescue Exception => exc | |
STDERR.puts "#{file_name} ロード時の一般エラー:#{exc.message}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment