What is the timeout exception name in App Engine?

For some reason, I got the impression that it's just called Timeout, but it doesn't seem to be.

Thanks!

+3
source share
2 answers

Timeout exception handling is explained in the Request Timer section in the docs:

The request handler has a limited amount of time to generate and return a response to the request, usually about 30 seconds. Once the deadline is reached, the request handler will be interrupted.

Python , DeadlineExceededError google.appengine.runtime. , , HTTP- .

, . ( ) .

from google.appengine.runtime import DeadlineExceededError

class MainPage(webapp.RequestHandler):
  def get(self):
    try:
      # Do stuff...

    except DeadlineExceededError:
      self.response.clear()
      self.response.set_status(500)
      self.response.out.write("This operation could not be completed in time...")     

, .

30 , App Engine , , . . , App Engine.

DataStore TimeOut

google.appengine.ext.db :

[...]

exception Timeout()
, , .

+3

- google.appengine.ext.db.Timeout. ( ) google.appengine.runtime.DeadlineExceededError. DeadlineExceeded "soft" , , ; , , , script .

+7

Source: https://habr.com/ru/post/1709349/


All Articles