您应该对成员函数向您掷出的所有异常编制文档,以便其它程序员知道他们的代码将需要捕捉什么。
You should document any and all exceptions that a member function throws at you so that other programmers know what their code will need to catch.
在这两个函数中,循环处理警告或异常。
In both of these functions, you loop over the warnings or exceptions.
c语言没有包含一种内置的功能来处理异常,因此默认情况下,如果您不处理函数的返回值,它就会将其忽略。
C doesn't include a built-in capability to handle exceptions, so by default it ignores any function returns if you don't do anything with them.
当然,那些函数也没有任何实现,所以调用它们将只抛出异常。
Of course, those functions don't have any implementations yet, so calling them will just throw an exception.
如果发生错误,函数之一抛出异常,那么整个过程回退。
If it does, and one of the functions throws an exception, the entire process rolls back.
重写随后执行的函数指针或异常处理程序。
Overwriting a function pointer or exception handler that is subsequently executed.
使用此函数时将抛出一个异常并显示给用户。
When using this function an exception will be thrown and displayed to the user.
该脚本的主函数看上去基本与前面具的示例相同,除了几个微不足道的异常。
The main function of this script looks basically the same as the previous example with a few minor exceptions.
这个属性可以告诉编译器,使用该属性声明的函数以及它调用的后续函数都不会引发异常。
This attribute is a hint to the compiler that the function declared with this attribute and the subsequent functions it calls do not throw an exception.
如果您调用一个可能抛出检查异常的已有函数,您应编写一个包装器函数,捕获并处理此类异常,然后在XSLT中调用包装器方法。
If you invoke a preexisting function that can throw a checked exception, you should write a wrapper function that catches and handles that exception; then, invoke the wrapper method from XSLT instead.
当错误发生时,v8会抛出一个异常。比如,当一个脚本或者函数试图去访问一个并不存在的属性,或者调用一个并不是函数的函数。
V8 will throw an exception if an error occurs - for example, when a script or function attempts to read a property that does not exist, or if a function is called that is not a function.
异常处理的最常见用法是中断一个函数,将异常提交给调用程序(可能是该调用程序,或者是堆栈中上级调用程序)。
The most common use of exception handling is breaking out of a function to raise an exception to a caller (which may be the caller or a caller higher up the stack).
正如之前的例子所示,print函数抛出了一个异常,原因是文件尚未打开以供写入。
As in the previous example, the print function raises an exception, because the file was not open for writing.
一些最重要的新功能可能包括异常处理、扩展函数、函数指针和/或lambda表达式。
Some of the most significant possible new features include exception handling, extension functions, function pointers, and/or lambda expressions.
如果您的扩展函数抛出了一个异常,Xalan将关闭。
If your extension function throws an exception, Xalan shuts down.
您还必须在处理结束时调用stermthread函数,以避免异常终结对运行中的LotusDomino服务器造成影响。
You must also call the stermThread function at the end of processing to prevent any abnormal terminations from affecting the running Lotus Domino server.
库中的函数使用filesystem_error异常报告操作错误。
Functions in the library use filesystem_error exceptions to report operational errors.
如果还没有创建XMLHttpRequest对象,或者已经发送了请求,那么checkRequest()函数将抛出一个异常。
The checkRequest() function will throw an exception if the XMLHttpRequest object has not been created or if the request has already been sent.
当在执行一个函数期间抛出一个异常时,LotusConnections就会显示一个错误页面(见图3)。
Lotus Connections displays an error page (see figure 3) when an exception is thrown during the execution of a function.
gdb指出在程序第7行发生一个算术异常,通常它会打印这一行以及wib函数的自变量值。
Gdb indicates that the program gets an arithmetic exception at line 7 and usefully prints out the line and the values of the arguments to the wib function.
如果遇到不认识的选项,或者选项没有包含必需的值,getopt函数会抛出异常。
An exception will be thrown by the getopt function when an unrecognized option is encountered, or if an option doesn't contain a required value.
成员函数带来的任何异常。
Any exceptions that a member function brings to your attention.
这意味着参数依次是int 、char* (s 表示字符串)和 int ; 而且如果抛出一个异常,则该函数称作 TrayIcon.send_message 。
send_message; this means that the parameters are an int, a char* (s for string), and an int; and that if an exception is thrown, the function is called TrayIcon.send_message.
如果坐标完全是错的(例如,不可能存在的纬度值100.0),那么ST _ Point函数可能引发异常。
If the coordinates are completely wrong (for example, an impossible latitude value of 100.0), the ST_Point function may be the one to raise an exception.
清单6. submissiontag函数:对输入错误抛出异常。
Listing 6. The submissionTag function: Throwing exceptions on input violations.
第2种方法:当缺少所需构造函数时,抛出异常。
No. 2: Throw an exception when needed constructor is missing.
为了解决这一问题,可以在抛出异常语句期间,在异常对象的构造函数中生成一个堆栈跟踪。
To deal with this, you can generate a stack trace in the constructor of the exception object during the throw exception statement.
当创建自己的异常类型时,您还应该另外添加两个构造函数。
When creating your own exception types, you should add the extra two constructors also.
但是不要因此而自满——您仍然需要了解我们所调用的函数会触发哪些异常,以及如何适当地处理这些异常。
But don't be complacent — you still have to know what exceptions can be thrown by what you're calling and how to handle them appropriately.
类型构造函数的另一个独特行为是运行库管理类型构造函数中的异常的方式。
Another behavior unique to type constructors is how the runtime manages exceptions in a type constructor.
应用推荐