error-handlers on app.yaml

耗尽温柔 提交于 2019-12-11 02:26:12

问题


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. What am I missing?

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


回答1:


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.



来源:https://stackoverflow.com/questions/6774451/error-handlers-on-app-yaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!