只有在可以合理地预期调用者可以处理异常时,DAO接口中的方法才应该抛出检查过的异常。
Methods in the DAO interface should throw checked exceptions only if the caller can reasonably be expected to handle the exception.
使用此函数时将抛出一个异常并显示给用户。
When using this function an exception will be thrown and displayed to the user.
当四个方法都顺利运行而没有抛出异常时,用测试客户机进行的测试就完成了。
When all four methods run without throwing exceptions, then testing with the test client is complete.
如果它不能获得服务,就会重新抛出它在试图获取服务时收到的异常。
If it cannot acquire the service, it re-throws the exception it received during its attempt to acquire the service.
通常,至于选择何种方法,取决于是否能在抛出异常时合理地处理异常。
Normally, the choice depends on whether you can plausibly handle the exception at the point where it's thrown.
在调试编译时它会抛出一个异常,但是在发布编译时它可能无警告地泄漏内存。
For debug builds it throws an exception, but for release builds it may silently leak memory.
在转换过程中,参数名是可以被忽略的,但最好还是定义一个合适的名称(以备异常抛出时正确提示)。
The name of the parameter doesn't matter, because it is ignored during transformation, but it is better to select a name that properly identifies it as an exception being thrown.
如果存储库不支持通配符,那么在遇到通配符和LIKE操作符时应该抛出异常。
In the case that wildcards are not supported by your repository, you will throw an exception when you encounter a wildcard with a LIKE operator.
这个方法返回HTTP响应中的内容字符串,在失败时抛出定制的异常。
The method returns a string of content from the HTTP response and throws a custom exception in the case of a failure.
在清单3中的代码中,在方法结束时总是抛出一个异常,所以强制回滚。
In the code in Listing 3, there's an exception that is always thrown at the end of the method, thereby forcing a rollback.
NotSupportedException:由于有对应的属性来标示他是否被支持而导致执行一个方法失败时,就会抛出这个异常。
NotSupportedException: Throw this exception when a type does not implement a method for which there is a corresponding property indicating whether or not the method in question is supported.
否则,容器提交CMPbean事务时将抛出异常,或发生数据完整性问题。
Otherwise, exceptions will be thrown when the container commits the CMP bean's transaction, or data integrity problems will occur.
Session包含读(级别1)和写(级别2)方法;使用底层仓库不支持的功能时将抛出异常。
Sessioncontains method for both reading (level 1) and writing (level 2); using functionality not supported by the underlying repository will thrown an exception.
此文件将包含在运行Eclipse时可能抛出的所有错误或异常。
This file contains all the errors or exceptions that might have been thrown while running Eclipse.
很容易忘记在使用资源的代码不抛出已检查的异常时使用finally。
It's also easy to forget to use finally when the code that USES the resource doesn't throw checked exceptions.
现在我可以为pop方法编写行为,即确保当栈在逻辑上为空时,抛出一个异常。
Now I can code the behavior for the pop method, which ensures that if the stack is logically empty, an exception will be thrown.
如果您只想在遇到未定义的情况时抛出异常,那么就没必要使用落后的 (object,object) 模式对 x_with_y()进行初始化。
The initialization of x_with_y() with a fallback (object,object) pattern is not necessary if you simply want undefined cases to raise an exception.
使用SQLprovider时,垃圾回收线程抛出异常。
An exception is thrown on the garbage collection thread when you use SQL providers.
您需要管理这样的异常:每当所选的库不存在时就会抛出该异常。
You need to manage the exception that is thrown whenever the chosen library is not present. The example, then, has to be updated.
当应用程序试图通过类的字符串名称,使用以下三种方法装入类,但却找不到指定名称的类定义时抛出该异常。
Thrown when an application tries to load in a class through its string name using
当你捕获到一个异常时,你甚至不知道这个异常是从哪个地方抛出的。
By the time you catch an exception, you have no record of where the exception was thrown.
当决定抛出何种类型的异常时,您应该总是首先考虑将要处理所报告异常的层。
When determining what type of exception to throw, you should always first consider the tier that will handle the reported exception.
为了看到使用不正确映射时抛出的异常,需要在您选择的厂商的软件上创建一个数据库,然后根据上面描述的把当前的后端ID设置为不正确的值。
To see exceptions generated by using the improper mapping, create a database in the vender software of your choice, then set the current backend ID value as instructed above to the incorrect value.
当组件抛出应用出错时,他们可以在组件边界内通过适当的接口记录异常,然后再抛出异常。
When components throw application errors, they could log the exception at the appropriate interface within the component boundaries and then throw the exceptions.
本文首先讨论了当服务器抛出不同的异常时客户端的预期行为,然后强调了已检查的异常的使用。
This article first discusses the expected behaviour on the client when the server throws various exceptions, and then emphasizes the use of checked exceptions.
当断言失败时,就会抛出一个异常。
一般情况下,DOM实现必须检验操作的正确性,并在应用程序传递错误参数或者执行非法操作时抛出异常。
Normally, a DOM implementation must verify the correctness of operations and throw an exception if an application passes the wrong parameters or performs an illegal operation.
当没有匹配的构造函数时,抛出运行时异常。
Throw an exception at run time when there is no matching constructor.
必要时该类可以在公开的方法中抛出任何异常。
The class may throw any exceptions in the exposed methods, as necessary.
虽然我们不想创建在无法预期时抛出运行时异常的程序,但这种情况还是会发生——尤其是第一次运行复杂程序时。
While we don't like to create programs that throw runtime exceptions at unexpected times, it happens — especially when running complex programs for the first time.
应用推荐