@@ -526,15 +526,30 @@ def _handle_add_undetermined(self):
526
526
target_dir = f"{ repo_name } /{ pr_number } /{ sequence_number } /{ task_file_name } "
527
527
task_description_file_path = f"{ target_dir } /TaskDescription"
528
528
task_state_file_path = f"{ target_dir } /TaskState.{ TaskState .NEW_TASK .name } "
529
- self .git_repo .create_file (task_description_file_path ,
530
- f"new task description for { repo_name } PR { pr_number } seq { sequence_number } " ,
531
- self .description .get_contents (), branch = branch )
532
- self .git_repo .create_file (task_state_file_path ,
533
- f"new task state for { repo_name } PR { pr_number } seq { sequence_number } " ,
534
- "" , branch = branch )
529
+ try :
530
+ self .git_repo .create_file (task_description_file_path ,
531
+ f"new task description for { repo_name } PR { pr_number } seq { sequence_number } " ,
532
+ self .description .get_contents (), branch = branch )
533
+ except Exception as err :
534
+ log_message (LoggingScope .TASK_OPS , 'ERROR' , "Error creating task description file: %s" , err )
535
+ return TaskState .UNDETERMINED
536
+ log_message (LoggingScope .TASK_OPS , 'INFO' ,
537
+ "task description file created: %s" , task_description_file_path )
538
+
539
+ try :
540
+ self .git_repo .create_file (task_state_file_path ,
541
+ f"new task state for { repo_name } PR { pr_number } seq { sequence_number } " ,
542
+ "" , branch = branch )
543
+ except Exception as err :
544
+ log_message (LoggingScope .TASK_OPS , 'ERROR' , "Error creating task state file: %s" , err )
545
+ return TaskState .UNDETERMINED
546
+ log_message (LoggingScope .TASK_OPS , 'INFO' , "task state file created: %s" , task_state_file_path )
547
+
535
548
self ._create_symlink (self .description .task_object .remote_file_path , target_dir , branch = branch )
536
- # TODO: verify that the sequence number is still valid (PR corresponding to the sequence number is still open or
537
- # yet to be created); if it is not valid, perform corrective actions
549
+ log_message (LoggingScope .TASK_OPS , 'INFO' , "symlink created: %s -> %s" ,
550
+ self .description .task_object .remote_file_path , target_dir )
551
+ # TODO: verify that the sequence number is still valid (PR corresponding to the sequence number is still
552
+ # open or yet to be created); if it is not valid, perform corrective actions
538
553
return TaskState .NEW_TASK
539
554
540
555
@log_function_entry_exit ()
0 commit comments