Changeset 693


Ignore:
Timestamp:
Jul 21, 2008, 3:46:05 PM (16 years ago)
Author:
price
Message:

don't give 500 for mere stdout on a redirect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/main.py

    r667 r693  
    697697            e = revertStandardError()
    698698            if e:
    699                 if isinstance(output, basestring):
    700                     sys.stderr = StringIO()
    701                     x = str(output)
    702                     print >> sys.stderr, x
    703                     print >> sys.stderr, 'XXX'
    704                     print >> sys.stderr, e
    705                     raise Exception()
    706                 output.addError(e)
     699                if hasattr(output, 'addError'):
     700                    output.addError(e)
     701                else:
     702                    # This only happens on redirects, so it'd be a pain to get
     703                    # the message to the user.  Maybe in the response is useful.
     704                    output = output + '\n\nstderr:\n' + e
    707705            output_string =  str(output)
    708706            checkpoint.checkpoint('output as a string')
Note: See TracChangeset for help on using the changeset viewer.