From 4750a3526415132120713c6631007bb07700e028 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 21 Jul 2008 15:46:05 -0400 Subject: [PATCH 1/1] don't give 500 for mere stdout on a redirect svn path=/trunk/packages/sipb-xen-www/; revision=693 --- code/main.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/main.py b/code/main.py index 24254c7..f13fe0c 100755 --- a/code/main.py +++ b/code/main.py @@ -696,14 +696,12 @@ class App: headers.update(new_headers) e = revertStandardError() if e: - if isinstance(output, basestring): - sys.stderr = StringIO() - x = str(output) - print >> sys.stderr, x - print >> sys.stderr, 'XXX' - print >> sys.stderr, e - raise Exception() - output.addError(e) + if hasattr(output, 'addError'): + output.addError(e) + else: + # This only happens on redirects, so it'd be a pain to get + # the message to the user. Maybe in the response is useful. + output = output + '\n\nstderr:\n' + e output_string = str(output) checkpoint.checkpoint('output as a string') except Exception, err: -- 1.7.9.5