Rookie Rookie - 2 months ago 23
Python Question

Handle RequestTooLargeError exception in Appengine

When i try to insert 1000+ list into appengine datastore, i gout this error

RequestTooLargeError: The request to API call datastore_v3.Put() was too large.


Tried to import this

from google.appengine.ext.db import RequestTooLargeError
try:
.....
except RequestTooLargeError:
logging.error("RequestTooLargeError")


But getting
ImportError: cannot import name RequestTooLargeError


How to catch this
RequestTooLargeError
exception in appengine?

Answer

The exception is on this module:

from google.appengine.runtime.apiproxy_errors import RequestTooLargeError