Skip to content

Commit

Permalink
[SDK] Raise more human-readable name conflict exception
Browse files Browse the repository at this point in the history
Co-authored-by: andreafehrman <andrea.k.fehrman@vanderbilt.edu>
Co-authored-by: harrisonfritz <harrisonmichaelfritz@gmail.com>
  • Loading branch information
3 people committed Aug 8, 2023
1 parent 888bec3 commit d3d4c65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Expand Up @@ -105,7 +105,11 @@ def create_experiment(
raise TimeoutError(
f"Timeout to create Katib Experiment: {namespace}/{experiment.metadata.name}"
)
except Exception:
except Exception as e:
if hasattr(e, "status") and e.status == 409:
raise Exception(
f"A Katib Experiment with the name {namespace}/{experiment.metadata.name} already exists."
)
raise RuntimeError(
f"Failed to create Katib Experiment: {namespace}/{experiment.metadata.name}"
)
Expand Down

0 comments on commit d3d4c65

Please sign in to comment.