我按照Custom Error Responses执行 - app.yaml更新为
error_handlers:
- error_code: over_quota
file: templates/over_quota.html
并创建了相应的文件。但仍显示错误(异常)而不是该页面。我试图将文件放在根文件夹中(在app.yaml上有相应的更新) - 它没有帮助。
我做错了什么?
UPD 即可。我按照以下方式定义了@Gwyn Howell评论。
handlers:
- url: /over_quota.html
static_files: templates/over_quota.html
upload: templates/over_quota.html
error_handlers:
- error_code: over_quota
file: over_quota.html
但是(1)如何测试它,(2)哪个url用户会在结果中看到? http://www.example.com/over_quota.html
或者它是原始网址吗?
答案 0 :(得分:2)
您将查看特定的配额,例如数据存储区操作,这会引发异常,而不会超过您的实例小时配额。仅当App Engine由于缺少配额而无法向实例发送请求时,才会显示超额配额错误消息;如果请求发送到您的应用程序,但您尝试执行超出可用配额的操作,则由您自行处理异常。