handle error when api endpoint not available

This commit is contained in:
Ondrej Samohel 2019-10-03 13:48:59 +02:00
parent 14fd3fa2da
commit 8f75f714e2
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7

View file

@ -56,7 +56,11 @@ class CreateRenderGlobals(avalon.maya.Creator):
self.log.info(">>> Loading Muster credentials ...")
self._load_credentials()
self.log.info(">>> Logging in Muster ...")
self._authenticate()
try:
self._authenticate()
except requests.exceptions.ConnectionError:
self.log.error("Cannot connect to Muster API endpoint.")
raise RuntimeError("Cannot connect to {}".format(muster_url))
self.log.info(">>> Getting pools ...")
pools = self._get_muster_pools()
pool_names = []