Skip to content

Commit

Permalink
Change exception types
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanScripts committed Feb 9, 2023
1 parent 4024a34 commit 25b613d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/dfcx_scrapi/tools/agent_checker_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(

self.agent_id = agent_id
if not self.agent_id:
raise Exception("agent_id parameter is required")
raise ValueError("agent_id parameter is required")

self._intents = Intents(creds=self.creds, agent_id=self.agent_id)
self._entities = EntityTypes(creds=self.creds, agent_id=self.agent_id)
Expand Down Expand Up @@ -236,7 +236,7 @@ def _get_page(
# Look up flow ID
flow_id = self._flows_map_rev.get(flow_name, None)
if not flow_id:
raise Exception(f"Flow not found: {flow_name}")
raise KeyError(f"Flow not found: {flow_name}")
# Now that flow_id is set, look up the page
# Special case for the start page
if page_name == "Start":
Expand Down Expand Up @@ -590,7 +590,7 @@ def find_reachable_pages(
"""
flow_id = self._flows_map_rev.get(flow_name, None)
if not flow_id:
raise Exception(f"Flow not found: {flow_name}")
raise KeyError(f"Flow not found: {flow_name}")

# Start at the start page...
reachable = [from_page]
Expand Down Expand Up @@ -649,7 +649,7 @@ def find_unreachable_pages(
"""
flow_id = self._flows_map_rev.get(flow_name, None)
if not flow_id:
raise Exception(f"Flow not found: {flow_name}")
raise KeyError(f"Flow not found: {flow_name}")

reachable = self.find_reachable_pages(
flow_name, include_groups=include_groups, verbose=verbose
Expand Down Expand Up @@ -775,7 +775,7 @@ def _get_page_intents(

flow_id = self._flows_map_rev.get(flow_name, None)
if not flow_id:
raise Exception(f"Flow not found: {flow_name}")
raise KeyError(f"Flow not found: {flow_name}")

# Get intents in transition route groups
if include_groups:
Expand Down

0 comments on commit 25b613d

Please sign in to comment.