Skip to content
Myr

Merge pull request #2917 from garenchan/docs1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Hsiaoming Yang · committed by GitHub · parents dcc02d6, 357b710 · Browse files · 1 file+4 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Docs: fix some errors in errorhandling.rst

Diff stats

1 file+4 added−9 removed

  • other:+4 added−9 removed

1 file+4 added−9 removed

modified:docs/errorhandling.rst+4 added-9 removed
73 unmodified lines
7475You might want to show custom error pages to the user when an error occurs.76This can be done by registering error handlers.7778An error handler is a normal view function that return a response, but instead78An error handler is a normal view function that returns a response, but instead79of being registered for a route, it is registered for an exception or HTTP80status code that would is raised while trying to handle a request.80status code that would be raised while trying to handle a request.8182Registering83```````````84
97 unmodified lines
182options in order to use your favorite debugger:183184* ``debug`` - whether to enable debug mode and catch exceptions185* ``use_debugger`` - whether to use the internal Flask debugger186* ``use_reloader`` - whether to reload and fork the process on exception186* ``use_reloader`` - whether to reload and fork the process if modules were changed187188``debug`` must be True (i.e., exceptions must be caught) in order for the other189two options to have any value.190
12 unmodified lines
203 if __name__ == "__main__":204 # To allow aptana to receive errors, set use_debugger=False205 app = create_app(config="config.yaml")206207 if app.debug: use_debugger = True208 try:209 # Disable Flask's debugger if external debugger is requested210 use_debugger = not(app.config.get('DEBUG_WITH_APTANA'))207 use_debugger = app.debug and not(app.config.get('DEBUG_WITH_APTANA'))211 except:212 pass208 app.run(use_debugger=use_debugger, debug=app.debug,209 use_reloader=use_debugger, host='0.0.0.0')