Skip to content

Commit

Permalink
Emit the exceptions before trying to parse them.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Oct 31, 2024
1 parent 523352a commit b5787b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions galaxykit/namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def get_namespace(client, name):
namespace = client.get(f"v3/namespaces/{name}/")
return namespace
except Exception as e:
logger.exception(e)
if e.args[0]["status"] == "404":
raise KeyError(f"No namespace {name} found.")
else:
Expand All @@ -42,6 +43,7 @@ def get_namespace_collections(client, name):
collection_list = client.get(f"_ui/v1/repo/published/?namespace={name}")
return collection_list
except Exception as e:
logger.exception(e)
if e.args[0]["status"] == "404":
raise KeyError(f"No namespace {name} found.")
else:
Expand Down

0 comments on commit b5787b1

Please sign in to comment.