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

State handler errors are not logged well #1326

Closed
cicdw opened this issue Aug 7, 2019 · 0 comments · Fixed by #1330
Closed

State handler errors are not logged well #1326

cicdw opened this issue Aug 7, 2019 · 0 comments · Fixed by #1330

Comments

@cicdw
Copy link
Member

cicdw commented Aug 7, 2019

Example:

from prefect import task, Flow

def handler(*args, **kwargs):
    raise SyntaxError("unique informative message")

@task(state_handlers=[handler])
def my_task():
    pass

f = Flow("reproducible-example", tasks=[my_task])

f.run()

# INFO - prefect.FlowRunner | Beginning Flow run for 'reproducible-example'
# INFO - prefect.FlowRunner | Starting flow run.
# DEBUG - prefect.FlowRunner | Flow 'reproducible-example': Handling state change from Scheduled to Running
# INFO - prefect.TaskRunner | Task 'my_task': Starting task run...
# DEBUG - prefect.TaskRunner | Task 'my_task': Handling state change from Pending to Running
# INFO - prefect.TaskRunner | Task 'my_task': finished task run for task with final state: 'Failed'
# INFO - prefect.FlowRunner | Flow run FAILED: some reference tasks failed.
# DEBUG - prefect.FlowRunner | Flow 'reproducible-example': Handling state change from Running to Failed

We should see an ERROR log displaying a repr of the exception that was thrown inside the state handler.

@cicdw cicdw added this to the v0.6.1 milestone Aug 7, 2019
abrookins pushed a commit that referenced this issue Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant