ruby的异常处理
Ruby的异常处理和java类似.从下面的例子大家可以看出:begin??? ==?tryraise???? ==?throwrescue? == catchensure? == finally
class EChartException < Exception #sthendclass EInvalidServerException < EChartException #sthendclass EServerDiedException < EChartException #sthenddef chat begin raise EServerDiedException rescue EInvalidServerException puts "Invalid server" rescue EServerDiedException puts "Server died" #raise ensure puts "ensure" endend#run herechat?