# HG changeset patch # User paulb # Date 1078962062 0 # Node ID 8f21e54236b789ff3226f5bcc4fec818600e807b # Parent f170a33a8aa7e15581c833356b42c9d7c0cb4405 [project @ 2004-03-10 23:41:02 by paulb] Tidied up error handling when Webware does not have a stream associated with the request. diff -r f170a33a8aa7 -r 8f21e54236b7 WebStack/Webware.py --- a/WebStack/Webware.py Sun Feb 29 00:20:19 2004 +0000 +++ b/WebStack/Webware.py Wed Mar 10 23:41:02 2004 +0000 @@ -6,6 +6,7 @@ import Generic from cgi import parse_qs +import StringIO class Transaction(Generic.Transaction): @@ -28,8 +29,16 @@ the transaction. """ - stream = self.trans.request().rawInput(rewind=1) - if stream is None: + request = self.trans.request() + try: + stream = request.rawInput(rewind=1) + if stream is None: + return StringIO.StringIO("") + + # NOTE: Dubious catch-all situation, but it is difficult to control + # NOTE: cases where Webware's internals themselves fail. + + except: return StringIO.StringIO("") return stream