Do report execution failures by throwing exceptions.
通过引发异常来报告执行故障。
Throwing exceptions is the responsibility of the event handlers.
抛出异常是事件处理器的责任。
Listing 8 demonstrates handling and throwing exceptions in a meaningful way.
清单8展示了以有意义的方式抛出和处理异常。
Listing 6. The submissionTag function: Throwing exceptions on input violations.
清单6. submissiontag函数:对输入错误抛出异常。
When all four methods run without throwing exceptions, then testing with the test client is complete.
当四个方法都顺利运行而没有抛出异常时,用测试客户机进行的测试就完成了。
Methods that use this comparator legitimately depend on it to compare two files, without throwing any exceptions.
使用这个比较器的方法合理地依靠它来比较两个文件,而不抛出任何异常。
Of course, if your application is throwing thousands of exceptions, you have more serious problems than big log files, but bear with me for illustrative purposes.
当然,如果应用程序抛出数千个异常,您的问题就比大的日志文件要严重得多了,但是姑且容许我为了说明问题而这样说。
Many times, you can do this simply by verifying arguments and throwing specific exceptions that tell why the supplied arguments are invalid.
许多时候,只需通过检验参数并抛出特定异常说明提供参数无效的原因就可以实现这一点。
Test failures are indicated by throwing unchecked exceptions, typically by using JUnit-provided assertion and failure methods.
测试失败通过抛出未经检查的异常来指示,通常使用JUnit提供的断言和故障方法指示。
" Writing good exceptions" (developerWorks, May 2003) offers some practical advice on throwing and catching exceptions and refining your exception-handling sensibilities.
“编写出色的异常 ”(developerWorks, 2003 年5 月)提供了一些关于抛出和捕获异常以及改善异常处理灵敏度的一些实际建议。
Unfortunately its failure model is a double-edged sword. Instead of throwing application-crashing exceptions, binding errors are quietly written to the trace listener.
然而遗憾的是,其失败模型是把双刃剑,它并不会抛出应用崩溃异常,而是将绑定错误直接写到追踪监听器当中。
If the test fixture runs without throwing any unhandled exceptions, and all of the Assert statements pass without problems, the test Results window shows a green light.
如果测试装置运行后没弹出任何未处理异常,并且所有断言都通过而没有问题,测试结果窗口显示绿色信号。
A CER defines an area in which the common language runtime (CLR) is constrained from throwing out-of-band exceptions that would prevent the code in the area from executing in its entirety.
CER定义一个区域,在该区域中公共语言运行时(CLR)会受到约束,不能引发可使区域中的代码无法完全执行的带外异常。
A CER defines an area in which the common language runtime (CLR) is constrained from throwing out-of-band exceptions that would prevent the code in the area from executing in its entirety.
CER定义一个区域,在该区域中公共语言运行时(CLR)会受到约束,不能引发可使区域中的代码无法完全执行的带外异常。
应用推荐