Seth Stokes
03/17/2025, 9:33 PMGracefulErrorAdapter 's in this way?
I'd like to be able to catch multipleexceptions in this way.
It is currently not working as expected.
from selenium.common.exceptions import WebDriverException, TimeoutException
dr = (
driver.Builder()
.with_modules(dataflow)
.with_adapters([
base.PandasDataFrameResult(),
GracefulErrorAdapter(
error_to_catch=WebDriverException,
sentinel_value=pd.DataFrame()
),
GracefulErrorAdapter(
error_to_catch=TimeoutException,
sentinel_value=pd.DataFrame()
)
])
.build()
)Stefan Krawczyk
03/18/2025, 4:23 AMdr = (
driver.Builder()
.with_modules(dataflow)
.with_adapters([
base.PandasDataFrameResult(),
GracefulErrorAdapter(
error_to_catch=(WebDriverException, TimeoutException),
sentinel_value=pd.DataFrame()
)
])
.build()
)Elijah Ben Izzy
03/18/2025, 4:31 AMsentinel really shouldn't be used like that IMO -- it's very odd. Sentinel value is just an object to pass around that we can compare for equality and that will be unique. It defaults to some preset object IIRC. So you should use the standard sentinel. We have not allowed for multiple adapters -- I think tuples should work? @Stefan Krawczyk that's clever if it does, it's a cool approachStefan Krawczyk
03/18/2025, 4:33 AMSeth Stokes
03/18/2025, 12:54 PMSeth Stokes
03/21/2025, 12:04 AM*splat the list of adapters. It didn’t raise any error, but that what it took for the adapter to work