# HG changeset patch # User Sverre Rabbelier # Date 1235938703 0 # Node ID f2f352ad193f9a17d495d8aa4e3d7165fc24cfa1 # Parent 4484186d74275879194225eb468f86c1d28d4ca2 Redirect to an error page when a GAE exception occurs Patch by: Sverre Rabbelier diff -r 4484186d7427 -r f2f352ad193f app/soc/content/assertion_error.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/assertion_error.html Sun Mar 01 20:18:23 2009 +0000 @@ -0,0 +1,6 @@ + +Something went wrong + +We ran into a problem while serving your request, please try again. + + diff -r 4484186d7427 -r f2f352ad193f app/soc/content/deadline_exceeded.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/deadline_exceeded.html Sun Mar 01 20:18:23 2009 +0000 @@ -0,0 +1,6 @@ + +We ran out of time + +We ran out of processing time while serving your request, please try again. + + diff -r 4484186d7427 -r f2f352ad193f app/soc/content/memory_error.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/memory_error.html Sun Mar 01 20:18:23 2009 +0000 @@ -0,0 +1,6 @@ + +We ran out of memory + +We ran out of memory while serving your request, please try again. + + diff -r 4484186d7427 -r f2f352ad193f app/soc/views/helper/decorators.py --- a/app/soc/views/helper/decorators.py Sun Mar 01 20:00:54 2009 +0000 +++ b/app/soc/views/helper/decorators.py Sun Mar 01 20:18:23 2009 +0000 @@ -45,15 +45,15 @@ def view_wrapper(*args, **kwds): try: return func(*args, **kwds) - except DeadlineExceededError: - logging.exception('DeadlineExceededError') - return http.HttpResponse('DeadlineExceededError') - except MemoryError: - logging.exception('MemoryError') - return http.HttpResponse('MemoryError') - except AssertionError: - logging.exception('AssertionError') - return http.HttpResponse('AssertionError') + except DeadlineExceededError, e: + logging.exception(e) + return http.HttpResponseRedirect('/soc/content/deadline_exceeded.html') + except MemoryError, e: + logging.exception(e) + return http.HttpResponseRedirect('/soc/content/memory_error.html') + except AssertionError, e: + logging.exception(e) + return http.HttpResponseRedirect('/soc/content/assertion_error.html') return view_wrapper