开发者

error-handlers on app.yaml

开发者 https://www.devze.com 2023-03-22 02:56 出处:网络
How to handle different error codes on app engine? In my app.yaml file, I have- error_handlers: - file: error/notfound.html

How to handle different error codes on app engine? In my app.yaml file, I have-

error_handlers:
  - file: error/notfound.html

  - error_code: over_quota
    file: error/over_quota.html

handlers:
..some handlers..

This doesn't seem to work. If my site doesn't have a folder name foo and a user looks for http://mysite.com/foo, it just returns a standard 404 error, not the page I specified on app.yaml.

My static dir is separate from error dir. Both error and static dirs are inside project dir. W开发者_如何学运维hat am I missing?

Is there a way to show custom page rather than a custom response message?


The 404 error handler page will only be displayed if a URL fails to match any patterns in app.yaml. If your app is returning a 404, it's up to the app to display the error page you want - there's no way to tell the framework to display the default error page instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消