处理Appengine中的RequestTooLargeError异常

时间:2015-03-04 11:36:27

标签: python google-app-engine google-cloud-datastore

当我尝试将1000+列表插入appengine数据存储区时,我会发出此错误RequestTooLargeError: The request to API call datastore_v3.Put() was too large.

试图导入此

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

但获得ImportError: cannot import name RequestTooLargeError

如何在appengine中捕获此RequestTooLargeError异常?

1 个答案:

答案 0 :(得分:4)

该模块有例外:

from google.appengine.runtime.apiproxy_errors import RequestTooLargeError