log exception on invalid jenkins notifications

I have been playing with zuul on port 8001 using curl:

  curl http://127.0.0.1:8001/jenkins_endpoint

Had to `strace -f` the process to find out what was going wrong. Logging
the exception will simply make it easier to track possible issues coming
from the Jenkins Notification plugin..

Change-Id: I461146d0a6e7d63a0d8bedc3d4a6ad19e22548d6
Reviewed-on: https://review.openstack.org/13817
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Antoine Musso 2012-09-27 14:55:26 +02:00 committed by Jenkins
parent bb480fd092
commit 1e1a1552af
1 changed files with 5 additions and 1 deletions

View File

@ -64,7 +64,11 @@ class JenkinsCallback(threading.Thread):
return ['Zuul good.']
def jenkins_endpoint(self, request):
data = json.loads(request.body)
try:
data = json.loads(request.body)
except:
self.log.exception("Exception handling Jenkins notification:")
raise # let wsgi handler process the issue
if data:
self.log.debug("Received data from Jenkins: \n%s" %
(pprint.pformat(data)))