相反,您应该对此类条件使用未经检查的异常,以便能够可选地处理这些条件。
Instead, you should use unchecked exceptions for such conditions, so that you can optionally handle these conditions.
例如,如果股票交易系统遇到问题,则该服务可能因某种未经检查的异常而无法获得报价。
For example, if the stock exchange system runs into a problem, the service might fail to obtain the quote with some kind of unchecked exceptions.
测试失败通过抛出未经检查的异常来指示,通常使用JUnit提供的断言和故障方法指示。
Test failures are indicated by throwing unchecked exceptions, typically by using JUnit-provided assertion and failure methods.
ServiceLocator还可以将检查的异常(在Bean查找或创建过程中引发的异常)转换为未经检查的异常。
The ServiceLocator can also translate the checked exceptions (that get thrown during lookup or creation of the bean) into unchecked exceptions.
出于这个目的,我将定义ArgumentErrorException作为一个未经检查的异常,如果出现了某个这一类的错误,就将抛出这个异常。
For this purpose I'll define ArgumentErrorException as an unchecked exception to be thrown if one of these errors occurs.
还要注意,Objectify的异常未经检查—这表示我无需担心捕捉到很多exception类型。
Also note that Objectify's exceptions are unchecked - which means I don't have to worry about catching a bunch of exception types.
正如前面提到过的,此层次结构中的异常未经检查。
As mentioned previously, the exceptions in this hierarchy are unchecked.
正如前面提到过的,此层次结构中的异常未经检查。
As mentioned previously, the exceptions in this hierarchy are unchecked.
应用推荐