@@ -272,24 +272,23 @@ def parameter_info(self) -> dict[str, Any]:
272
272
273
273
@property
274
274
def templates_configuration (self ) -> list [tuple [str , str ]]:
275
+ templates : list [tuple [str , str ]] = []
275
276
try :
276
- templates : list [tuple [str , str ]] = []
277
277
with open (self .mount_point / self ._templates_file , encoding = "utf-8" ) as f :
278
278
templates = json .load (f )
279
- templates_with_content : list [tuple [str , str ]] = []
280
- for source_file , target_file in templates :
281
- try :
282
- file_content = (self .mount_point / source_file ).read_text ("utf-8" )
283
- templates_with_content .append ((file_content , target_file ))
284
- except UnicodeDecodeError as e :
285
- raise ValueError (
286
- f"Unsupported non UTF-8 character found in file: { source_file } "
287
- ) from e
288
- return templates_with_content
289
279
except (FileNotFoundError , json .JSONDecodeError ):
290
- pass
291
280
# If the file is missing or broken, we return an empty list
292
- return []
281
+ pass
282
+ templates_with_content : list [tuple [str , str ]] = []
283
+ for source_file , target_file in templates :
284
+ try :
285
+ file_content = (self .mount_point / source_file ).read_text ("utf-8" )
286
+ templates_with_content .append ((file_content , target_file ))
287
+ except UnicodeDecodeError as e :
288
+ raise ValueError (
289
+ f"Unsupported non UTF-8 character found in file: { source_file } "
290
+ ) from e
291
+ return templates_with_content
293
292
294
293
@property
295
294
def response_info (self ) -> dict [str , Any ]:
0 commit comments