Use expected exception for BitBucket OAuth error

Prevents from having a 500 when BitBucket OAuth doesn't work, as it will be caught in web.py/attach_bitbucket_trigger
This commit is contained in:
Quentin Machu 2015-10-22 11:24:17 -04:00
parent 674c16bf3b
commit 37a4dafe40

View file

@ -300,7 +300,7 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
bitbucket_client = self._get_client() bitbucket_client = self._get_client()
(result, data, err_msg) = bitbucket_client.get_authorization_url() (result, data, err_msg) = bitbucket_client.get_authorization_url()
if not result: if not result:
raise RepositoryReadException(err_msg) raise TriggerProviderException(err_msg)
return data return data
@ -547,4 +547,3 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
repository_name, lookup_author) repository_name, lookup_author)
return self.prepare_build(metadata, is_manual=True) return self.prepare_build(metadata, is_manual=True)