changeset 3352:bbc4932e0fa7

merged main
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Mar 2008 16:01:18 +0100
parents 55102b9ed091 (current diff) 81697026ee86 (diff)
children 8e615ef236e2
files
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/xmlrpc/__init__.py	Thu Mar 20 16:00:13 2008 +0100
+++ b/MoinMoin/xmlrpc/__init__.py	Thu Mar 20 16:01:18 2008 +0100
@@ -133,11 +133,20 @@
                 response = xmlrpclib.Fault(1, "This moin wiki does not allow xmlrpc method calls.")
             else:
                 data = self.request.read()
-                params, method = xmlrpclib.loads(data)
 
-                logging.debug(logging_tearline % 'request begin')
-                logging.debug('%s(%s)' % (method, repr(params)))
-                logging.debug(logging_tearline % 'request end')
+                try:
+                    params, method = xmlrpclib.loads(data)
+                except:
+                    # if anything goes wrong here, we want to see the raw data:
+                    logging.debug("Length of raw data: %d bytes" % len(data))
+                    logging.debug(logging_tearline % 'request raw data begin')
+                    logging.debug('%r' % data)
+                    logging.debug(logging_tearline % 'request raw data end')
+                    raise
+
+                logging.debug(logging_tearline % 'request parsed data begin')
+                logging.debug('%s(%r)' % (method, params))
+                logging.debug(logging_tearline % 'request parsed data end')
 
                 response = self.dispatch(method, params)
         except: