[pypy-svn] r41712 - pypy/dist/pypy/translator/js/examples

fijal at codespeak.net fijal at codespeak.net
Fri Mar 30 16:33:40 CEST 2007


Author: fijal
Date: Fri Mar 30 16:33:37 2007
New Revision: 41712

Modified:
   pypy/dist/pypy/translator/js/examples/overmind.py
Log:
Make error reporting better, now I can log all errors and
investigate them later.


Modified: pypy/dist/pypy/translator/js/examples/overmind.py
==============================================================================
--- pypy/dist/pypy/translator/js/examples/overmind.py	(original)
+++ pypy/dist/pypy/translator/js/examples/overmind.py	Fri Mar 30 16:33:37 2007
@@ -53,7 +53,14 @@
            <body onload="bnb_redirect()">
            </body>
         </html>'''
-    bnb.exposed = True    
+    bnb.exposed = True
+
+    def handle_error(self, exc, e_value, tb):
+        tb_formatted = '\n'.join(traceback.format_tb(tb)) + \
+                       "%s: %s" % (exc, e_value)
+        log_file = open("/tmp/play1_error_log", "a")
+        log_file.write(tb_formatted)
+        log_file.close()
 
 class Handler(server.NewHandler):
     application = Root()



More information about the Pypy-commit mailing list