Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
Stay organized with collections
Save and categorize content based on your preferences.
google.appengine.api.urlfetch_errors module
Summary
Errors used in the urlfetch API.
Contents
- exception google.appengine.api.urlfetch_errors.DeadlineExceededErrorsource
-
Bases: google.appengine.api.urlfetch_errors.DownloadError
The URL was not fetched because the deadline was exceeded.
This can occur with either the client-supplied deadline
, or the system
default if the client does not supply a deadline
parameter.
- exception google.appengine.api.urlfetch_errors.DownloadErrorsource
-
Bases: google.appengine.api.urlfetch_errors.Error
The URL could not be retrieved.
This exception is only raised when we cannot contact the server. HTTP errors
(such as 404) are returned in the status_code
field in the return value of
fetch
, and no exception is raised.
- exception google.appengine.api.urlfetch_errors.Errorsource
-
Bases: exceptions.Exception
Base URL fetcher error type.
- exception google.appengine.api.urlfetch_errors.InvalidURLErrorsource
-
Bases: google.appengine.api.urlfetch_errors.Error
The URL given was empty or invalid.
Only HTTP and HTTPS URLs are allowed. The maximum URL length is 2048
characters. The login and password portion is not allowed. In deployed
applications, only ports 80 and 443 for HTTP and HTTPS respectively are
allowed.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThis module defines various error exceptions for the \u003ccode\u003eurlfetch\u003c/code\u003e API in Google App Engine.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDownloadError\u003c/code\u003e is a base exception raised when the server cannot be contacted, and it has child exceptions like \u003ccode\u003eConnectionClosedError\u003c/code\u003e, \u003ccode\u003eDNSLookupFailedError\u003c/code\u003e, \u003ccode\u003eDeadlineExceededError\u003c/code\u003e, \u003ccode\u003eMalformedReplyError\u003c/code\u003e, and \u003ccode\u003eTooManyRedirectsError\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eError\u003c/code\u003e is a general base error type for all \u003ccode\u003eurlfetch\u003c/code\u003e errors, including those not directly related to downloads like \u003ccode\u003eInternalTransientError\u003c/code\u003e, \u003ccode\u003eInvalidMethodError\u003c/code\u003e, \u003ccode\u003eInvalidURLError\u003c/code\u003e, \u003ccode\u003eResponseTooLargeError\u003c/code\u003e, and \u003ccode\u003eSSLCertificateError\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eInvalidURLError\u003c/code\u003e is raised when the URL is empty, invalid, or exceeds length limits, and \u003ccode\u003ePayloadTooLargeError\u003c/code\u003e is an extension of this error.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeadlineExceededError\u003c/code\u003e exception signifies that a URL fetch failed because the specified or default time limit was exceeded.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.urlfetch_errors module\n===========================================\n\nSummary\n-------\n\nErrors used in the urlfetch API.\n\nContents\n--------\n\n*exception* google.appengine.api.urlfetch_errors.ConnectionClosedError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#ConnectionClosedError)\n\n: Bases: [google.appengine.api.urlfetch_errors.DownloadError](#google.appengine.api.urlfetch_errors.DownloadError)\n\nThe target server prematurely closed the connection. \n\n*exception* google.appengine.api.urlfetch_errors.DNSLookupFailedError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#DNSLookupFailedError)\n\n: Bases: [google.appengine.api.urlfetch_errors.DownloadError](#google.appengine.api.urlfetch_errors.DownloadError)\n\nThe DNS lookup for a URL failed. \n\n*exception* google.appengine.api.urlfetch_errors.DeadlineExceededError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#DeadlineExceededError)\n\n: Bases: [google.appengine.api.urlfetch_errors.DownloadError](#google.appengine.api.urlfetch_errors.DownloadError)\n\n The URL was not fetched because the deadline was exceeded.\n\n This can occur with either the client-supplied `deadline`, or the system\ndefault if the client does not supply a `deadline` parameter. \n\n*exception* google.appengine.api.urlfetch_errors.DownloadError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#DownloadError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\n The URL could not be retrieved.\n\n This exception is only raised when we cannot contact the server. HTTP errors\n (such as 404) are returned in the `status_code` field in the return value of\n`fetch`, and no exception is raised. \n\n*exception* google.appengine.api.urlfetch_errors.Error[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#Error)\n\n: Bases: exceptions.Exception\n\nBase URL fetcher error type. \n\n*exception* google.appengine.api.urlfetch_errors.InternalTransientError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#InternalTransientError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\nAn internal transient error occurred. \n\n*exception* google.appengine.api.urlfetch_errors.InvalidMethodError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#InvalidMethodError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\nAn invalid value was provided for `method`. \n\n*exception* google.appengine.api.urlfetch_errors.InvalidURLError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#InvalidURLError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\n The URL given was empty or invalid.\n\n Only HTTP and HTTPS URLs are allowed. The maximum URL length is 2048\n characters. The login and password portion is not allowed. In deployed\n applications, only ports 80 and 443 for HTTP and HTTPS respectively are\nallowed. \n\n*exception* google.appengine.api.urlfetch_errors.MalformedReplyError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#MalformedReplyError)\n\n: Bases: [google.appengine.api.urlfetch_errors.DownloadError](#google.appengine.api.urlfetch_errors.DownloadError)\n\n The target server returned an invalid HTTP response.\n\n Responses are invalid if they contain no headers, malformed or incomplete\nheaders, or have content missing. \n\n*exception* google.appengine.api.urlfetch_errors.PayloadTooLargeError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#PayloadTooLargeError)\n\n: Bases: [google.appengine.api.urlfetch_errors.InvalidURLError](#google.appengine.api.urlfetch_errors.InvalidURLError)\n\nThe request payload exceeds the limit. \n\n*exception* google.appengine.api.urlfetch_errors.ResponseTooLargeError(response)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#ResponseTooLargeError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\nThe response was too large and was truncated. \n\n*exception* google.appengine.api.urlfetch_errors.SSLCertificateError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#SSLCertificateError)\n\n: Bases: [google.appengine.api.urlfetch_errors.Error](#google.appengine.api.urlfetch_errors.Error)\n\nAn invalid server certificate was presented. \n\n*exception* google.appengine.api.urlfetch_errors.TooManyRedirectsError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/urlfetch_errors#TooManyRedirectsError)\n\n: Bases: [google.appengine.api.urlfetch_errors.DownloadError](#google.appengine.api.urlfetch_errors.DownloadError)\n\n `follow_redirects` was set to True, and the redirect limit was hit."]]