2010-10-06 70 views
1

Google App Engine UrlFetchService有一个setDeadline FetchOption,假设在触发时引发异常。URLFetchService超时抛出哪个异常?

该应用程序可以指定拨打电话时等待的最长时间。如果超过最长等待时间,则该呼叫引发异常。

哪个例外?

如果是IOException,我应该如何区分截止时间超时和其他原因?

回答

1

将引发google.appengine.api.urlfetch.DownloadError。

+0

也许这个错误类没有在java平台上定义?在appengine-api-1.0-sdk.1.3.7.jar文件中找不到DownloadError类。 http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/urlfetch/package-tree.html – Stevko 2010-10-11 23:32:50

+0

嘿,Nick J,你能否告诉我DownloadError类是公开的还是私人和什么类延伸? – Stevko 2010-10-14 18:44:45

0

找到以下由urlfetch服务定义/抛出的异常列表。

不确定是否ApiDeadlineExceededException是一个。

com.google.apphosting.api.ApiProxy.UnknownException 
    com.google.apphosting.api.ApiProxy.ResponseTooLargeException 
    com.google.apphosting.api.ApiProxy.RequestTooLargeException 
    com.google.apphosting.api.ApiProxy.OverQuotaException 
    com.google.apphosting.api.ApiProxy.FeatureNotEnabledException 
    com.google.apphosting.api.ApiProxy.CapabilityDisabledException 
    com.google.apphosting.api.ApiProxy.CancelledException 
    com.google.apphosting.api.ApiProxy.ApiDeadlineExceededException 
    com.google.apphosting.api.ApiProxy.ArgumentException 
    com.google.apphosting.api.ApiProxy.CallNotFoundException 
    com.google.apphosting.api.ApiProxy.RPCFailedException 
    com.google.apphosting.api.ApiProxy.ApplicationException 
    com.google.apphosting.api.ApiProxy.ApiProxyException