Skip to content
Myr

Fix docs errors

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

1.Grammar error: 'return' should be 'returns'; 'would is' should be 'would be'. 2.Reloader is used to reload and fork process if modules were changed rather than when an exception occurred. 3.The sample code is not concise enough.

authored by garenchan · committed by garenchan · parent c92001d · 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.

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
74 unmodified lines
7576You might want to show custom error pages to the user when an error occurs.77This can be done by registering error handlers.7879An error handler is a normal view function that return a response, but instead79An error handler is a normal view function that returns a response, but instead80of being registered for a route, it is registered for an exception or HTTP81status code that would is raised while trying to handle a request.81status code that would be raised while trying to handle a request.8283Registering84```````````85
97 unmodified lines
183options in order to use your favorite debugger:184185* ``debug`` - whether to enable debug mode and catch exceptions186* ``use_debugger`` - whether to use the internal Flask debugger187* ``use_reloader`` - whether to reload and fork the process on exception187* ``use_reloader`` - whether to reload and fork the process if modules were changed188189``debug`` must be True (i.e., exceptions must be caught) in order for the other190two options to have any value.191
12 unmodified lines
204 if __name__ == "__main__":205 # To allow aptana to receive errors, set use_debugger=False206 app = create_app(config="config.yaml")207208 if app.debug: use_debugger = True209 try:210 # Disable Flask's debugger if external debugger is requested211 use_debugger = not(app.config.get('DEBUG_WITH_APTANA'))208 use_debugger = app.debug and not(app.config.get('DEBUG_WITH_APTANA'))212 except:213 pass209 app.run(use_debugger=use_debugger, debug=app.debug,210 use_reloader=use_debugger, host='0.0.0.0')