Bryan Chavez
01/15/2022, 2:28 AMcontext.failure_event.message
sandy
01/18/2022, 4:11 PMyuhan
01/18/2022, 5:35 PMcontext.failure_event.event_specific_data.error
provides info about the error detailsBryan Chavez
01/19/2022, 3:59 PMyuhan
01/19/2022, 5:13 PMBryan Chavez
01/19/2022, 9:47 PMyuhan
01/19/2022, 9:49 PM@run_failure_sensor
def my_sensor(context):
run_id = context.dagster_run.run_id
step_failure_event = context.instance.all_logs(
run_id=run_id, of_type=DagsterEventType.STEP_FAILURE
)
print(step_failure_event.event_specific_data.error)
this should get you the right stack trace.context.failure_event.event_specific_data.error
.Bryan Chavez
01/22/2022, 1:27 AMerror = context.failure_event.event_specific_data.error
if not error:
event_logs = context.instance.all_logs(
run_id=run_id,
of_type=DagsterEventType.STEP_FAILURE,
) or []
error = '<br><br>'.join([e.message for e in event_logs])
yuhan
01/22/2022, 1:47 AMBryan Chavez
03/15/2022, 11:15 PMyuhan
03/15/2022, 11:35 PMBryan Chavez
03/16/2022, 4:26 PMyuhan
03/21/2022, 5:00 PM.user_message
? can you get the same error info from that property?Bryan Chavez
03/22/2022, 12:49 AMstep_failure_event_logs = (
context.instance.all_logs(
run_id=run_id,
of_type=DagsterEventType.STEP_FAILURE,
)
or []
)
if step_failure_event_logs:
errors = '<br><br>'.join(
[
str(e.dagster_event.event_specific_data.error)
for e in step_failure_event_logs[:NUMBER_OF_ERRORS]
]
)
if not errors:
errors = str(context.failure_event.event_specific_data.error)
but just want to know if you know why the behavior changed and also confirmation that above would capture all the scenariosyuhan
03/22/2022, 3:27 AMDagster Bot
06/16/2022, 8:03 AM