Skip to content

Commit 3fa5054

Browse files
committed
update exception thrown
1 parent ce7a99b commit 3fa5054

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sagemaker/jumpstart/accessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def get_model_specs(
320320
return model_specs
321321
except Exception as ex:
322322
# Failed with both, throw a custom error message
323-
raise Exception(
323+
raise RuntimeError(
324324
f"Cannot get details for {model_id} in Hub {hub_arn}. \
325325
{model_id} does not exist as a Model or ModelReference: \n"
326326
+ str(ex)

src/sagemaker/jumpstart/hub/hub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def describe_model(
273273
self, model_name: str, hub_name: Optional[str] = None, model_version: Optional[str] = None
274274
) -> DescribeHubContentResponse:
275275
"""Describe Model or ModelReference in a Hub."""
276-
hub_name = self.hub_name if not hub_name else hub_name
276+
hub_name = hub_name or self.hub_name
277277

278278
# Users only input model id, not contentType, so first try to describe with ModelReference, then with Model
279279
try:
@@ -319,7 +319,7 @@ def describe_model(
319319

320320
except Exception as ex:
321321
# Failed with both, throw a custom error message
322-
raise Exception(
322+
raise RuntimeError(
323323
f"Cannot get details for {model_name} in Hub {hub_name}. \
324324
{model_name} does not exist as a Model or ModelReference in {hub_name}: \n"
325325
+ str(ex)

0 commit comments

Comments
 (0)