If there is a problem, catch the exception and go from there.
如果出现问题,要捕获异常并加以处理。
When to catch the Exception vs When to throw the Exceptions?
当捕获异常与何时抛出的异常?
And even if you catch the exception, it is possible that a connection will be left open.
即使你捕获了异常,仍有可能一直保持连接。
That's why the listing is written to catch the exception but doesn't actually do anything with it.
这就是清单中包含异常捕获功能,但实际却没有进行任何操作的原因。
If the calling code does catch the exception, the pipe consumer will still see the error, but there will not be a duplicate error.
如果调用代码捕获了异常,则管道使用者仍将看到错误,但不会有重复错误。
Since the remote file may not exist yet, we need to catch the exception that Net: : SFTP will throw when we try to determine its timestamp.
由于远程文件可能不存在,所以我们需要捕捉当我们试图去查看一个不存在的文件的时间戳的时候Net: SFTP抛出的异常。
If, however, an error is encountered when the EJB processes the request, the servlet will catch the exception thrown by the EJB and instantiate an ErrorBean to encapsulate the error message.
但是,如果当eJB处理请求时遇到错误,servlet将捕获e JB抛出的异常并将Error Bean实例化,封装出错消息。
By the time you catch an exception, you have no record of where the exception was thrown.
当你捕获到一个异常时,你甚至不知道这个异常是从哪个地方抛出的。
The SOAP method call is performed within a try - except block, which is generally good style, but here we do it specifically to catch a SOAP.faultType exception.
SOAP方法调用是在try-except块中执行的,一般来说,这种方式比较好,但这里我们这样做只是捕捉 SOAP.faultType异常。
This is — as you might expect — an exception handler, which will now catch the E739 error that is thrown if mkdir is unable to create the requested directory.
这就是——如您所期待的——一个异常处理器,它现在将会捕捉如果mkdir不能创建请求的目录而被抛出的E739错误。
As an alternative, you can catch this exception directly in your code and handle it some other way (perhaps printing out the actual error message along with usage information, for instance).
一个替代的方法是,您也可以在代码中直接捕捉这个异常,并且用其他方式处理异常(例如,可能会与使用信息一起输出真正的错误消息)。
For transparent switch over, applications can be coded to catch the StaleConnection exception and retry a specified number of times to obtain new connection handles.
为了能够透明地切换,可以将应用程序编码为捕获StaleConnection异常,并重试指定的连接次数来获取新的连接句柄。
What's new in 1.4 is that if you rethrow an exception from the catch clause, you can attach the original cause of the exception.
发行版 1.4中的新功能是如果从catch 子句重新抛出了一个异常,您可以附加上该异常的初始原因。
First, the program did not hit the catch clause for an exception of type ApplicationException, even though that's the type of exception thrown from the static constructor.
第一,该程序不会为类型是ApplicationException的异常寻找catch子句,即使这种类型的异常是从静态构造函数引发的也如此。
A try... catch structure changes the runtime exception behavior to what is specified in the catch clause.
catch结构将运行时异常行为更改为catch子句中所指定的行为。
When Derby shuts down a database, it throws an SQLException with an SQLState of 08006, which is why the catch block ignores this exception.
Derby关闭数据库时,将抛出SQLException,使用08006作为SQLState,这就是catch块忽略此异常的原因。
Problem is, the only exception I catch is the base class.
现在的问题是,我只能捕获基类这个异常。
Client code calling the data logic method can catch the user-defined exception.
客户端代码调用数据逻辑方法可以捕获用户定义的异常。
In case of an exception, the catch block simply called the exception publisher, then returned the executing thread back to the thread pool.
如果发生了异常,这个catch块只是简单地调用异常发布程序,然后将正在执行的线程返回到线程池中。
When an exception is thrown, the runtime will begin to look for the nearest catch clause whose filters specify that it can handle the exception.
在引发异常时,运行库将开始查找其筛选器指定它可以处理该异常的最近的 catch 子句。
If you like, you can assert something about the thrown exception in the catch block. For example, Listing 6 checks that FunctionContext is not serializable.
如果愿意,您还可在catch中作出一些关于所抛出异常的断言。
If so, the current driver does not add the catch block for any custom exception thrown by the Web service.
如果有,则表明当前驱动器没有为Web服务抛出的自定义异常添加批处理块。
This way you can find the unexpected exceptions during the testing phase and address them in some manner more appropriate than a catch for all exception types.
这个方法在测试以及定位这些异常的时候,您可以找到这些意外的异常,总比接收所有异常类型要更加合适。
To disable exception handling, you need to remove all try and catch blocks from the sources and compiling the code using the /GX- option.
要禁用异常处理,您需要从源代码中删除所有的try和catch块,并使用 /GX-选项编译代码。
If the service throws an exception, then this code falls into the catch block.
如果服务引发异常,则此代码将进入catch块。
The method will catch other exceptions such as MalformedURLException and IOException and throw the custom exception so that it can be caught by the GWT client.
方法捕捉其他异常(比如MalformedURLException和IOException)并抛出定制的异常,让GWT客户机可以捕捉到它。
It iterates the list of catch blocks, and if it finds one that catches Exception, it looks again for a catch block that catches RuntimeException for the same range of bytecodes.
它将迭代捕获块的列表,如果发现捕获Exception的块,它会再次查找捕获块,该捕获块将捕获字节码同一范围的RuntimeException。
Because the value of value is out of range, an exception is thrown that is caught in the catch block.
因为value的值超出了范围,所以抛出了一个被catch块捕获的异常。
If the content isn't supported, the code throws an exception, which is caught by the try-catch block.
如果内容不受支持,那么代码抛出一个异常,此异常由try - catch块捕捉到。
It's important that you catch this exception and add it to the QueryResults, and that you do not stop the execution of the ItemFinder.
重要的是,捕获这个异常并将它添加到QueryResults中,而且并不停止ItemFinder的执行。
应用推荐