Ray's playground

 

Exceptions, Catch, and Throw(Chapter 10 of Programming Ruby)

1 begin
2   eval string
3 rescue SyntaxError, NameError => boom
4   print "String doesn't compile: " + boom
5 rescue StandardError => bang
6   print "Error running script: " + bang
7 end

 

posted on 2010-07-04 17:41  Ray Z  阅读(132)  评论(0编辑  收藏  举报

导航