On 11/15/2013 04:31 PM, Milan Zazrivec wrote:
> If you could please send an updated patch, I will gladly apply it to
> spacewalk.git.

Thanks for the feedback. I've attached an updated version of the patch.

Cheers
Flavio


-- 
Flavio Castelli
SUSE LINUX Products GmbH
Maxfeldstraße 5, 90409 Nürnberg Germany
>From 60ae084513bf3c12f909f932cbe20e73874762d9 Mon Sep 17 00:00:00 2001
From: Flavio Castelli <fcaste...@suse.com>
Date: Mon, 18 Nov 2013 10:24:17 +0100
Subject: [PATCH] python server: better logging of exceptions

Ensured all the exceptions are logged, no matter which log level is being
used by the logger.
---
 backend/server/apacheRequest.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/backend/server/apacheRequest.py b/backend/server/apacheRequest.py
index 145189a..b669ae9 100644
--- a/backend/server/apacheRequest.py
+++ b/backend/server/apacheRequest.py
@@ -157,7 +157,7 @@ class apacheRequest:
                 log_debug(2, "Server Group Membership EXCEEDED")
                 f = rhnFault(44, e.errmsg)
             if not f:
-                log_debug(4, "rhnSQL.SQLSchemaError caught", e)
+                log_error("rhnSQL.SQLSchemaError caught", e)
                 rhnSQL.rollback()
                 # generate the traceback report
                 Traceback(method, self.req,
@@ -166,13 +166,14 @@ class apacheRequest:
                 return apache.HTTP_INTERNAL_SERVER_ERROR
             response = f.getxml()
         except rhnSQL.SQLError, e:
-            log_debug(4, "rhnSQL.SQLError caught", e)
+            log_error("rhnSQL.SQLError caught", e)
             rhnSQL.rollback()
             Traceback(method, self.req,
                       extra="SQL Error generated: %s" % e,
                       severity="schema")
             return apache.HTTP_INTERNAL_SERVER_ERROR
-        except:
+        except Exception, e:
+            log_error("Unhandled exception", e)
             rhnSQL.rollback()
             # otherwise we do a full stop
             Traceback(method, self.req, severity="unhandled")
-- 
1.8.1.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to