qadmin: catch and show python exceptions
authorMarko Kreen <markokr@gmail.com>
Wed, 8 Dec 2010 13:59:04 +0000 (15:59 +0200)
committerMarko Kreen <markokr@gmail.com>
Wed, 8 Dec 2010 13:59:04 +0000 (15:59 +0200)
python/qadmin.py

index 6be44d0cf25a397d98e75fae4c7c3372c4c6c29f..ed9d7fc2ab6b16ba0f6f2ceaf1821850eec97198 100755 (executable)
@@ -96,7 +96,7 @@ General options:
     --version
 '''
 
-import sys, os, readline, getopt, re, psycopg2
+import sys, os, readline, getopt, re, psycopg2, traceback
 
 import pkgloader
 pkgloader.require('skytools', '3.0')
@@ -864,6 +864,7 @@ class AdminConsole:
             try:
                 ln = self.line_input()
                 self.exec_string(ln)
+                raise Exception('exctest')
             except KeyboardInterrupt:
                 print
             except EOFError:
@@ -871,6 +872,8 @@ class AdminConsole:
                 break
             except psycopg2.Error, d:
                 print 'ERROR:', str(d).strip()
+            except Exception:
+                traceback.print_exc()
             self.reset_comp_cache()
 
         try: