Commit c91dc12 Dominick Leppich
committed
1 parent d489d4b commit c91dc12 Copy full SHA for c91dc12
File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,18 @@ def process_mets_file(self):
37
37
logging .error (error )
38
38
self .ctx .log_issue (self .file_path , error )
39
39
return
40
-
41
- root = tree .getroot ()
42
- self .process_node (root )
40
+ try :
41
+ root = tree .getroot ()
42
+ self .process_node (root )
43
43
44
- if self .changed and not self .ctx .dry :
45
- self .create_backup ()
46
- tree .write (self .file_path , encoding = 'utf-8' , xml_declaration = True )
47
- self .ctx .log_processed (self .file_path )
44
+ if self .changed and not self .ctx .dry :
45
+ self .create_backup ()
46
+ tree .write (self .file_path , encoding = 'utf-8' , xml_declaration = True )
47
+ self .ctx .log_processed (self .file_path )
48
+ except Exception as e :
49
+ error = f'Something very unexpected happened during processing of mets file { self .file_path } : { e } '
50
+ logging .critical (error )
51
+ raise Exception (error )
48
52
49
53
def process_node (self , node ):
50
54
if self .is_manual_id_reference (node ):
You can’t perform that action at this time.
0 commit comments