From 81e96d6c1d89b0fe139b5f7222194a69bc0b58b6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 2 Mar 2017 16:33:47 -0500 Subject: [PATCH] Fix merge breakage --- buildtrigger/githubhandler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildtrigger/githubhandler.py b/buildtrigger/githubhandler.py index 7c47df4ff..a6df8a979 100644 --- a/buildtrigger/githubhandler.py +++ b/buildtrigger/githubhandler.py @@ -362,8 +362,14 @@ class GithubBuildTrigger(BuildTriggerHandler): def load_dockerfile_contents(self): config = self.config gh_client = self._get_client() - source = config['build_source'] + + try: + repo = gh_client.get_repo(source) + except GithubException as ghe: + message = ghe.data.get('message', 'Unable to list contents of repository: %s' % source) + raise RepositoryReadException(message) + path = self.get_dockerfile_path() try: file_info = repo.get_file_contents(path)