This response should throw an exception because the temperature value is not a float type — it is actually a string.
这个响应会抛出一个异常,因为温度的值不是浮点类型—它实际上是一个字符串。
You can throw any kind of exception you like - checked, runtime, or error - as long as the method signature supports it.
可以抛出您需要的任何类型的异常(已检查、运行时或错误),只要方法签名支持它即可。
To deal with this, you can generate a stack trace in the constructor of the exception object during the throw exception statement.
为了解决这一问题,可以在抛出异常语句期间,在异常对象的构造函数中生成一个堆栈跟踪。
It has properties, but if you try to set a property of it which is does not contain, it will not throw an exception like normal data objects.
它具有属性,但如果尝试设置其不包含的属性,它不会引发异常,这一点与普通数据对象不同。
Throw an exception whenever a run-time instantiation of the generic class does not include a needed constructor.
只要泛型类的运行时实例化没有包括所需的构造函数,就抛出异常。
When determining what type of exception to throw, you should always first consider the tier that will handle the reported exception.
当决定抛出何种类型的异常时,您应该总是首先考虑将要处理所报告异常的层。
When components throw application errors, they could log the exception at the appropriate interface within the component boundaries and then throw the exceptions.
当组件抛出应用出错时,他们可以在组件边界内通过适当的接口记录异常,然后再抛出异常。
Unless you change this property, a command that runs for over 30 seconds will time out and throw an exception.
除非更改此属性,否则运行30秒后,命令就会超时,并且将抛出一个异常。
If a query USES a combination of columns that are not indexed, GAE will only throw an exception at run time when the query is executed.
如果查询使用没有进行索引的列的组合,那么当执行查询时,GAE将只在运行时出现一个异常。
If the document is not parsed and the objects made persistent within 30 seconds, then the server will throw an exception and the objects will not be created.
如果文档没有被解析且对象在30秒内进行持久化,则服务器将抛出一个异常且对象将不会创建。
And the code that reads the file should check to make sure that the version number is less than or equal to its current version and throw an exception if it's not.
而读取文件的代码应该检查这个版本号,以保证版本号小于或者等于当前版本,否则就会抛出一个异常。
Whenever your connector encounters an invalid literal in a search, it should throw an exception informing the user that this particular value cannot be searched on.
当连接器在搜索中遇到无效文字时,它应该抛出异常,通知用户不能搜索这个值。
So this API is to invoke a service where that does not have a return value but that could throw an exception.
因此,此api用于调用并不返回值但可能引发异常的服务。
This service code is generated in the form of a skeleton implementation, with service methods that just throw an exception.
此服务代码以框架实现的形式生成,其中包含直接引发异常的服务方法。
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.
这个属性可以告诉编译器,使用该属性声明的函数以及它调用的后续函数都不会引发异常。
If the criterion is not met you can raise an exception using the Throw node.
如果不满足条件,您可以使用Throw节点引发一个异常。
No. 2: Throw an exception when needed constructor is missing.
第2种方法:当缺少所需构造函数时,抛出异常。
Please note that you still need to throw whatever exception is caught by the invoked code (in this case, IOException).
请注意您还是需要抛出由被调用代码捕获的异常(在本例中,为IOException)。
As Linda stated, the behavior is simple: If someone calls push with a null value, the stack should throw an exception.
正如Linda所说,行为很简单:如果有人对null值调用push,那么栈应该抛出一个异常。
For instance, Linda stated that a stack should throw an exception if a user attempted to place null onto it.
例如,Linda说,如果用户试图将null放到栈上,那么栈应该抛出一个异常。
The checkRequest() function will throw an exception if the XMLHttpRequest object has not been created or if the request has already been sent.
如果还没有创建XMLHttpRequest对象,或者已经发送了请求,那么checkRequest()函数将抛出一个异常。
And yes, you throw an exception by writing throw new MyBadException (...).
而且一样的,你可以通过写thrownew My BadException(…)来抛出异常。
There were two options for what should happen when the retrieval timeout occurs: return null or throw an exception.
对于在检索超时发生时应当发生的事情,有两个选择:返回null或者引发异常。
Throw exception: If an error is encountered, an exception is thrown and the operation is not performed.
Throw exception:如果突然出现一个错误,抛出一个异常,操作不能执行。
Ensure that your NL product, once released, will not throw an exception due to missing keywords from the translated files.
确保您的本地语言产品一旦发布将不会由于已翻译文件遗漏关键字而抛出异常。
The basic program in Listing 1 contains three methods that can all throw an exception.
清单1中的基本程序包含三个方法,这三个方法都可抛出异常。
If the server script does not check the data, either the database will throw an exception or the database will be compromised.
如果服务器脚本不检查数据,要么数据库抛出异常,要么数据库安全会受到影响。
More support for testing whether code does or doesn't throw an exception.
为测试提供了更多的支持,无论代码是否抛出异常。
Of course, those functions don't have any implementations yet, so calling them will just throw an exception.
当然,那些函数也没有任何实现,所以调用它们将只抛出异常。
When you publish it to outside clients, you want to check the arguments and throw an exception if the arguments are invalid.
当你将它向外界的客户公布时,你要检查实参并且如果实参无效,你要给出一个例外。
应用推荐