Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix exception logging: use exc_info=True #155

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions skyvern/webeye/actions/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ async def handle_action(
LOG.exception(
"Cannot handle multiple elements with the same xpath in one action.",
action=action,
exception=e,
)
return [ActionFailure(e)]
except Exception as e:
LOG.exception("Unhandled exception in action handler", action=action, exception=e)
LOG.exception("Unhandled exception in action handler", action=action)
return [ActionFailure(e)]


Expand Down Expand Up @@ -231,11 +230,7 @@ async def handle_select_option_action(
await option_locator.nth(action.option.index).click(timeout=2000)
return [ActionSuccess()]
except Exception as e:
LOG.error(
"Failed to click option",
action=action,
exception=e,
)
LOG.error("Failed to click option", action=action, exc_info=True)
return [ActionFailure(e)]
return [ActionFailure(Exception(f"SelectOption option index is missing"))]
elif role_attribute == "option":
Expand Down Expand Up @@ -298,7 +293,7 @@ async def handle_select_option_action(
await page.click(f"xpath={xpath}", timeout=SettingsManager.get_settings().BROWSER_ACTION_TIMEOUT_MS)
return [ActionSuccess()]
except Exception as e:
LOG.warning("Failed to click on the option by index", exception=e, action=action)
LOG.warning("Failed to click on the option by index", action=action, exc_info=True)
return [ActionFailure(e)]


Expand Down Expand Up @@ -612,13 +607,8 @@ async def click_listbox_option(
try:
await page.click(f"xpath={option_xpath}", timeout=1000)
return True
except Exception as e:
LOG.error(
"Failed to click on the option",
action=action,
option_xpath=option_xpath,
exception=e,
)
except Exception:
LOG.error("Failed to click on the option", action=action, option_xpath=option_xpath, exc_info=True)
if "children" in child:
bfs_queue.extend(child["children"])
return False
Loading