Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strike>you are using py27 with threadsafe environment. in app.yaml you set <code>script: main.app</code> so the code after app is defined is not executed.</p> <p>didn't test it but this should work:</p> <pre><code># create a bare app bare_app = webapp2.WSGIApplication(debug=True) #define the error handlers def handle_401(request, response, exception): logging.exception(exception) response.write("401 Error") response.set_status(401) def handle_403(request, response, exception): logging.exception(exception) response.write("403 Error") response.set_status(403) def handle_404(request, response, exception): logging.exception(exception) response.write("404 Error") response.set_status(404) def handle_500(request, response, exception): logging.exception(exception) response.write("500 Error") response.set_status(500) # add the error handlers bare_app.error_handlers[401] = handle_401 bare_app.error_handlers[403] = handle_403 bare_app.error_handlers[404] = handle_404 bare_app.error_handlers[500] = handle_500 bare_app.router.add((r'/', HomeHandler)) app = bare_app </code></pre> <p></strike> </p> <p><strong>edit</strong>:<br> use self.abort() instead of self.error()<br> <a href="http://webapp-improved.appspot.com/guide/exceptions.html#abort" rel="nofollow">http://webapp-improved.appspot.com/guide/exceptions.html#abort</a></p> <p>you can see the difference in the source code:<br> <a href="http://code.google.com/p/webapp-improved/source/browse/webapp2.py#574" rel="nofollow">http://code.google.com/p/webapp-improved/source/browse/webapp2.py#574</a><br> while self.error() sets the status code but clears the response, self.abort() executes the function that takes care of the error handling.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload