Rubyのexit関数
Rubyのexit関数はSystemExit例外を投げます。
begin exit rescue StandardError puts $!.class rescue SystemExit puts $!.class ensure puts "ensure" end puts "end"
実行結果は以下のとおり。
SystemExit ensure end
Rubyのexit関数はSystemExit例外を投げます。
begin exit rescue StandardError puts $!.class rescue SystemExit puts $!.class ensure puts "ensure" end puts "end"
実行結果は以下のとおり。
SystemExit ensure end