eclipse-basyx / basyx-python-sdk

MIT License
61 stars 28 forks source link

aasx: Add failsafe for writing and reading AASX files #228

Open WelliSolutions opened 10 months ago

WelliSolutions commented 10 months ago

You kindly told me about the failsafe parameter at the read_into() method.

I was now trying to write an AASX file which should have had an attachment, but doesn't. When writing the AASX file, an error message is printed, but no exception occurs.

The message is

Could not find file /aasx/files/file.txt in file store.

I'd rather have my program crash, so that the problem gets reported and fixed, rather than creating an invalid AASX file which may remain unnoticed for a long time. I tried failsafe=False as an additional parameter, but it seems that doesn't exist.

If no such feature exists, I'd like to request that.

s-heppner commented 10 months ago

I just checked our AASXWriter implementation and you're correct, there is no failsafe parameter implemented. I think it's a good addition, I'll adapt your issue and make a feature request out of it.