@@ -30,22 +30,19 @@ def export_metadata_task(uid, beamline_acronym=BEAMLINE_OR_ENDSTATION):
3030 logger .info (f"Found data file at { fpath_orig } , proceeding with metadata export." )
3131 else :
3232 logger .error (f"Data file not found at { fpath_orig } , aborting metadata export." )
33- return
33+ raise FileNotFoundError ( f"Data file not found at { fpath_orig } " )
3434
3535 # Copy the file to the destination directory and update the fpath variable
3636 # For example:
3737 # /nsls2/data3/esm/proposals/commissioning/pass-319467/assets/mbs/2025/12/11/sample_name/TEST_0002.nxs
3838 # /nsls2/data3/esm/proposals/commissioning/pass-319467/export/2025_12_11/sample_name/TEST_0002.nxs
39- try :
40- prefix , suffix = str (fpath_orig ).split ('assets' )
41- suffix = suffix .split ('/' , 2 )[- 1 ].replace ('/' , '_' , 2 )
42- fpath_dest = Path (prefix ) / 'export' / suffix
43- Path (fpath_dest ).parent .mkdir (parents = True , exist_ok = True )
44-
45- shutil .copy (fpath_orig , fpath_dest )
46- logger .info (f"File '{ fpath_orig } ' copied successfully to '{ fpath_dest } '" )
47- except Exception as e :
48- logger .error (f"An error occurred while copying the file: { e } " )
39+ prefix , suffix = str (fpath_orig ).split ('assets' )
40+ suffix = suffix .split ('/' , 2 )[- 1 ].replace ('/' , '_' , 2 )
41+ fpath_dest = Path (prefix ) / 'export' / suffix
42+ Path (fpath_dest ).parent .mkdir (parents = True , exist_ok = True )
43+
44+ shutil .copy (fpath_orig , fpath_dest )
45+ logger .info (f"File '{ fpath_orig } ' copied successfully to '{ fpath_dest } '" )
4946
5047 # Read the metadata from Tiled
5148 primary = run_client ["primary" ].read (variables = ['mbs_escale_min' , 'mbs_escale_max' , 'mbs_num_steps' , \
0 commit comments