當前位置: 首頁>>代碼示例>>Python>>正文


Python urlfetch.ResponseTooLargeError方法代碼示例

本文整理匯總了Python中google.appengine.api.urlfetch.ResponseTooLargeError方法的典型用法代碼示例。如果您正苦於以下問題:Python urlfetch.ResponseTooLargeError方法的具體用法?Python urlfetch.ResponseTooLargeError怎麽用?Python urlfetch.ResponseTooLargeError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在google.appengine.api.urlfetch的用法示例。


在下文中一共展示了urlfetch.ResponseTooLargeError方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _handle_request_error

# 需要導入模塊: from google.appengine.api import urlfetch [as 別名]
# 或者: from google.appengine.api.urlfetch import ResponseTooLargeError [as 別名]
def _handle_request_error(self, e, url):
        if isinstance(e, urlfetch.InvalidURLError):
            msg = ("The Stripe library attempted to fetch an "
                   "invalid URL (%r). This is likely due to a bug "
                   "in the Stripe Python bindings. Please let us know "
                   "at support@stripe.com." % (url,))
        elif isinstance(e, urlfetch.DownloadError):
            msg = "There was a problem retrieving data from Stripe."
        elif isinstance(e, urlfetch.ResponseTooLargeError):
            msg = ("There was a problem receiving all of your data from "
                   "Stripe.  This is likely due to a bug in Stripe. "
                   "Please let us know at support@stripe.com.")
        else:
            msg = ("Unexpected error communicating with Stripe. If this "
                   "problem persists, let us know at support@stripe.com.")

        msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")"
        raise error.APIConnectionError(msg) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:20,代碼來源:http_client.py

示例2: _handle_request_error

# 需要導入模塊: from google.appengine.api import urlfetch [as 別名]
# 或者: from google.appengine.api.urlfetch import ResponseTooLargeError [as 別名]
def _handle_request_error(self, e, url):
        if isinstance(e, urlfetch.InvalidURLError):
            msg = ("The Shippo library attempted to fetch an "
                   "invalid URL (%r). This is likely due to a bug "
                   "in the Shippo Python bindings. Please let us know "
                   "at support@goshippo.com." % (url,))
        elif isinstance(e, urlfetch.DownloadError):
            msg = "There was a problem retrieving data from Shippo."
        elif isinstance(e, urlfetch.ResponseTooLargeError):
            msg = ("There was a problem receiving all of your data from "
                   "Shippo.  This is likely due to a bug in Shippo. "
                   "Please let us know at support@goshippo.com.")
        else:
            msg = ("Unexpected error communicating with Shippo. If this "
                   "problem persists, let us know at support@goshippo.com.")

        msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")"
        raise error.APIConnectionError(msg) 
開發者ID:goshippo,項目名稱:shippo-python-client,代碼行數:20,代碼來源:http_client.py


注:本文中的google.appengine.api.urlfetch.ResponseTooLargeError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。