The type attribute specifies the type of exception to be intercepted by this handler.
type属性指定了这个异常处理程序会截获的异常类型。
If any type of exception is thrown in a unit test, the DOH declares the entire test as failed.
如果在一个单元测试中有任何类型的异常被抛出,DOH就会宣布整个测试失败。
Whenever you get any type of exception in DB2, the next step is to find out where that error is coming from.
在DB 2中,无论何时收到任何类型的异常,接下来的一步就是找出那个错误的来源。
So, summarizing better, assert is something you put in to say to the user, make sure you're giving me input of this type, but I'm going to guarantee you the rest of the code works correctly. Exceptions and exception handlers are saying, here are the odd cases that I might see and here's what I'd like to do in those cases in order to try and be able to deal with them.
所以更好的总结下,断言就是你放在那里告诉用户,保证你输入的是这种类型的,但我能保证剩下的代码运行正确,异常和异常处理做的事,这里有些我能预期的异常情况,并且这里有些情况,我能尝试处理。
应用推荐