[Reproducible-commits] [misc] 06/06: We can use log.exception

Chris Lamb lamby at moszumanska.debian.org
Fri Sep 11 21:13:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit e6353531a7423be1568a4f0b84eeb1299285aa56
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Sep 11 22:13:04 2015 +0100

    We can use log.exception
---
 clean-notes | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/clean-notes b/clean-notes
index cd37ead..262cea5 100755
--- a/clean-notes
+++ b/clean-notes
@@ -9,7 +9,6 @@
 # Depends: python3 python3-apt python3-yaml python3-requests python3-psycopg2
 
 import apt
-import sys
 import json
 import yaml
 import logging
@@ -178,10 +177,8 @@ def start_udd_connection():
             else:
                 raise
     except:
-        log.error('Erorr connecting to the UDD database replica.' +
+        log.exception('Erorr connecting to the UDD database replica.' +
                   'The full error is:')
-        exc_type, exc_value, exc_traceback = sys.exc_info()
-        print_exception(exc_type, exc_value, exc_traceback)
         log.error('Failing nicely anyway, all queries will return an empty ' +
                   'response.')
         return None
@@ -199,10 +196,8 @@ def query_udd(query):
     try:
         cursor.execute(query)
     except:
-        log.error('The UDD server encountered a issue while executing the ' +
+        log.exception('The UDD server encountered a issue while executing the ' +
                   'query. The full error is:')
-        exc_type, exc_value, exc_traceback = sys.exc_info()
-        print_exception(exc_type, exc_value, exc_traceback)
         log.error('Failing nicely anyway, returning an empty response.')
         return []
     return cursor.fetchall()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list