File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -481,16 +481,21 @@ def on_chain_error(
481481 ) -> None :
482482 try :
483483 self ._log_debug_event ("on_chain_error" , run_id , parent_run_id , error = error )
484- self .runs [run_id ] = self .runs [run_id ].end (
485- level = "ERROR" ,
486- status_message = str (error ),
487- version = self .version ,
488- input = kwargs .get ("inputs" ),
489- )
484+ if run_id in self .runs :
485+ self .runs [run_id ] = self .runs [run_id ].end (
486+ level = "ERROR" ,
487+ status_message = str (error ),
488+ version = self .version ,
489+ input = kwargs .get ("inputs" ),
490+ )
490491
491- self ._update_trace_and_remove_state (
492- run_id , parent_run_id , error , input = kwargs .get ("inputs" )
493- )
492+ self ._update_trace_and_remove_state (
493+ run_id , parent_run_id , error , input = kwargs .get ("inputs" )
494+ )
495+ else :
496+ self .log .warning (
497+ f"Run ID { run_id } already popped from run map. Could not update run with error message"
498+ )
494499
495500 except Exception as e :
496501 self .log .exception (e )
You can’t perform that action at this time.
0 commit comments