【发布时间】:2011-04-11 21:07:36
【问题描述】:
我是编程方面的绝对初学者。我很喜欢 ruby 并设置了 koans。本节开头:
def test_you_dont_get_null_pointer_errors_when_calling_methods_on_nil
请解释这一行:
rescue Exception => ex
我已经弄清楚了本节的前两个公案。
【问题讨论】:
-
这称为“异常处理”。尝试检查维基百科。投票结束您的问题作为“一般参考”。
-
@Pavel +1 一般参考:ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html