Hi, I'd like to get access to the `State` object f...
# ask-community
m
Hi, I'd like to get access to the
State
object for a failed task, but I'm not sure how to do that when the task throws an exception. Any advice?
Copy code
try:
    state: State = trigger_sync.with_options(
        name=connection.name
    )(
        airbyte_server=airbyte_server,
        connection_id=connection.connection_id
    )
except AirbyteSyncJobFailed as e:
   // state is undefined
c
what’s the task call here? running a task by default returns just the data, to return state, it should be
task(return_state=True)