如果用户在尝试访问这个资源时还没有经过身份验证,那么用户会收到401状态码,应用程序可以提供一个特殊的错误处理函数来处理这种情况。
If a user is not authenticated when trying to access this resource, the user will receive a 401 status code and the application can provide a special error handler to deal with that condition.
如果就绪状态是4而且状态码是 200,就可以处理服务器的数据了,而且这些数据应该就是要求的数据(而不是错误或者其他有问题的信息)。
With a ready state of 4 and a status code of 200, you're ready to process the server's data and that data should be what you asked for (and not an error or other problematic piece of information).
为了增加更健壮的错误处理并尽量避免过于复杂,可以增加一两个状态码检查,请看一看清单15中修改后的updatePage()版本。
To add more robust error handling -- with minimal complication -- you might add a check or two for other status codes; check out the modified version of updatePage() in Listing 15.
如果已经设置了此变量,set——query返回状态码0,这表示没有出现错误;否则,返回1。
If the variable is set, set — query returns a status code of 0, indicating that no error occurred; otherwise, it returns a 1.
与其他使用HTTP的REST服务一样,TwitterAPI使用一组状态码和错误消息。
Like other REST services that use HTTP, the Twitter API sports a set of status codes and error messages.
这仅仅是HTTP请求能够收到的众多错误码中的一种(完整的状态码列表请参阅参考资料中的链接)。
This is just one of many status codes that HTTP requests can receive as a status (see Resources for a link to the complete list of status codes).
在这种情况下,我要讨论错误处理的三个方面:状态码,结构异常处理和错误检测。
In this section, I 'll describe three aspects of error handling: status codes, structured exception handling, and bug checks.
这类的状态码代表了客户端看起来可能发生了错误,妨碍了服务器的处理。
The 4xx class of status code is intended for cases in which the client seems to have erred.
除非响应的是一个HEAD请求,否则服务器就应该返回一个解释当前错误状况的实体,以及这是临时的还是永久性的状况。 这些状态码适用于任何请求方法。
Except when responding to a HEAD request, the server shouldinclude an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition.
包含特定事件记录档的状态码或错误码。
Contains the status code or error code for a specific event log.
若要覆写继承的错误设定,您可为要覆写的状态码加入本机自订错误。
You can override the inherited error Settings by adding a local custom error for the status code you want to override.
若要覆写继承的错误设定,您可为要覆写的状态码加入本机自订错误。
You can override the inherited error Settings by adding a local custom error for the status code you want to override.
应用推荐