How do we best cope with these exceptions?

Currently my app is failing to import a file in the top most url.py
file due to a google.appengine.runtime.DeadlineExceededError
exception.

I am using Django, is there a top most place I can catch all
exceptions and display a custom 500 message to the user?

Currently they get the uncaught exception message which is not ideal.

Do I have to put a try catch statement around the imports in the
url.py file?

Or is it best to add this to the main.py

def main():
  try:
    # Create a Django application for WSGI.
    application = django.core.handlers.wsgi.WSGIHandler()

    # Run the WSGI CGI handler with that application.
    util.run_wsgi_app(application)
  except:
    from django.shortcuts import render_to_response
    return render_to_response( '500.html' )

Thanks.

On May 26, 7:58 am, Andrew Cebulski <[email protected]> wrote:
> +1 Google Apps Short Links (runs Python) down too...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to