Skip to content

Commit

Permalink
add exception cases to get_analyzer_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
murilommen committed Dec 3, 2024
1 parent 5c89386 commit fc65122
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion whylabs_toolkit/helpers/monitor_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ def get_analyzer_ids(
if item["id"] == monitor_id:
resp = item["analyzerIds"]
return resp
except ForbiddenException:

except NotFoundException:
logger.warning(f"Could not find analyzer IDs for {org_id}, {dataset_id}, {monitor_id}")
return None

except ForbiddenException:
logger.error(f"Could not get analyzer id's due to a ForbiddenException, did you set a correct WHYLABS_API_KEY?")
return None

except Exception as e:
raise e


def get_analyzers(
monitor_id: str, org_id: Optional[str] = None, dataset_id: Optional[str] = None, config: Config = Config()
Expand Down

0 comments on commit fc65122

Please sign in to comment.