fix(sdk): fixes too broad except when retrieving experiments. (#4765)

This commit is contained in:
Tanguy Compagnon 2020-11-13 00:08:25 +01:00 committed by GitHub
parent 25aec5d857
commit 950fae4921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -305,9 +305,10 @@ class Client(object):
experiment = None
try:
experiment = self.get_experiment(experiment_name=name, namespace=namespace)
except:
except ValueError as error:
# Ignore error if the experiment does not exist.
pass
if not str(error).startswith('No experiment is found with name'):
raise error
if not experiment:
logging.info('Creating experiment {}.'.format(name))