X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/2b4e872eda2ebc5724caba7a33d05c964ae2751e..4750a3526415132120713c6631007bb07700e028:/code/main.py 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: