1

我按照自定义错误响应执行此操作- app.yaml 更新为

error_handlers:
- error_code: over_quota
  file: templates/over_quota.html

并创建相应的文件。但是仍然显示错误(异常)而不是该页面。我试图将文件放在根文件夹中(在 app.yaml 进行相应的更新) - 它没有帮助。

我究竟做错了什么?

更新。我根据@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还是会是原始网址?

4

1 回答 1

2

您将超出特定配额,例如引发异常的数据存储操作,而不会超出您的实例小时配额。仅当 App Engine 由于缺少配额而根本无法向实例发送请求时,才会显示超出配额的错误消息;如果请求被发送到您的应用程序,但您尝试执行超出可用配额的操作,则由您来处理您认为合适的异常。

于 2012-10-02T13:30:12.753 回答