Skip to content

Commit

Permalink
Extended try/except block in task_schedule_css_selector_generation to…
Browse files Browse the repository at this point in the history
… cover basically whole function
  • Loading branch information
ivnglkv committed Apr 21, 2024
1 parent 3647d51 commit e06aec9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/css_locators/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
def task_schedule_css_selector_generation(
self, document_path: str, elements_ids: List[str]
) -> List[Dict[str, str]]:
driver = get_webdriver()

driver.get(f"file:///html/{Path(document_path).name}")

result = []

# noinspection PyBroadException
# We need this try/except block to avoid sending stacktraces to the frontend
# but still log them
try:
driver = get_webdriver()

driver.get(f"file:///html/{Path(document_path).name}")

result = []
for element_id in elements_ids:
result.append({
"id": element_id,
Expand Down

0 comments on commit e06aec9

Please sign in to comment.