From 674c16bf3be490e93aa8f690b8ccd40cf1fe3178 Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Thu, 22 Oct 2015 11:21:34 -0400 Subject: [PATCH] Add logging on BitBucket schema validation exception Chatty but worthy No need to create a custom debugging web hook anymore for Bitbucket --- buildtrigger/bitbuckethandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildtrigger/bitbuckethandler.py b/buildtrigger/bitbuckethandler.py index 669702b79..879448456 100644 --- a/buildtrigger/bitbuckethandler.py +++ b/buildtrigger/bitbuckethandler.py @@ -183,6 +183,7 @@ def get_transformed_commit_info(bb_commit, ref, default_branch, repository_name, try: validate(bb_commit, BITBUCKET_COMMIT_INFO_SCHEMA) except Exception as exc: + logger.exception('Exception when validating Bitbucket commit information: %s from %s', exc.message, bb_commit) raise InvalidPayloadException(exc.message) commit = JSONPathDict(bb_commit) @@ -216,6 +217,7 @@ def get_transformed_webhook_payload(bb_payload, default_branch=None): try: validate(bb_payload, BITBUCKET_WEBHOOK_PAYLOAD_SCHEMA) except Exception as exc: + logger.exception('Exception when validating Bitbucket webhook payload: %s from %s', exc.message, bb_payload) raise InvalidPayloadException(exc.message) payload = JSONPathDict(bb_payload)