Skip to content

Commit

Permalink
Add exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jahaniam committed Jan 31, 2024
1 parent e36f150 commit 31ce760
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions streamlit_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ def get_session():

@st.cache_data
def get_endpoint_names():
sm_client = boto3.client("sagemaker")
response = sm_client.list_endpoints(
SortBy="CreationTime",
SortOrder="Descending",
)
endpoints = response["Endpoints"]
try:
sm_client = boto3.client("sagemaker")
response = sm_client.list_endpoints(
SortBy="CreationTime",
SortOrder="Descending",
)
endpoints = response["Endpoints"]
except:
endpoints = []
return endpoints


Expand Down

0 comments on commit 31ce760

Please sign in to comment.