@@ -286,7 +286,7 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
286286 print (f" - { annotated } " , file = sys .stderr )
287287 except Exception as e :
288288 if fail_on_error :
289- raise
289+ raise Exception ( f"Error annotating schema for { building_block . identifier } " ) from e
290290 traceback .print_exception (e , file = sys .stderr )
291291 if isinstance (e , ContextLoadError ):
292292 if e .__cause__ :
@@ -328,8 +328,8 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
328328 building_block .metadata ['ontology' ] = building_block .ontology .value
329329 except Exception as e :
330330 if fail_on_error :
331- raise BuildingBlockError (f'Error processing ontology for { building_block . identifier } ' )\
332- from e
331+ raise BuildingBlockError (f'Error processing ontology '
332+ f'for { building_block . identifier } ' ) from e
333333 print ("Exception when processing ontology for" , building_block .identifier , file = sys .stderr )
334334 traceback .print_exception (e , file = sys .stderr )
335335
@@ -338,6 +338,9 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
338338 base_url + os .path .relpath (building_block .remote_cache_dir .resolve (), cwd ) + '/'
339339 )
340340
341+ if isinstance (building_block .metadata .get ('schema' ), str ):
342+ building_block .metadata ['schema' ] = {'application/yaml' : building_block .metadata ['schema' ]}
343+
341344 child_bblocks .append (building_block )
342345
343346 if not steps or 'jsonld' in steps :
@@ -366,7 +369,7 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
366369 print (f" - { os .path .relpath (written_context )} " , file = sys .stderr )
367370 except Exception as e :
368371 if fail_on_error :
369- raise e
372+ raise Exception ( f'Error writing context for { building_block . identifier } ' ) from e
370373 print (f"[Error] Writing context for { building_block .identifier } : { type (e ).__name__ } : { e } " )
371374
372375 output_bblocks = []
0 commit comments