python-pyodata icon indicating copy to clipboard operation
python-pyodata copied to clipboard

[DO NOT MERGE]: tmp: annotate exceptions

Open filak-sap opened this issue 5 years ago • 4 comments

@mamiksik @phanak-sap Please, comment in the commit which serves the only purpose to mark exceptions we need to deal with.

See the file exceptions.txt and verify I didn't miss any case.

Then we should go through the exceptions again and classify them by the rules in exceptions.txt

filak-sap avatar Apr 15 '20 20:04 filak-sap

I think you did not miss any, however, looking at the code I think it would be good if a custom exception would be raised in method parse at line 159 if a value is None and in method property at line 1 222 when a property is not found.

Also before you pushed this commit I compiled the list of changes for last(closed) PR as requested https://github.com/mamiksik/python-pyodata/wiki/Exception-change-list, but I think there is of little use for it now.

mamiksik avatar Apr 17 '20 11:04 mamiksik

I think it is generally OK. I would like split the "service block" to distinguish somehow "metadata invalid" use case for usage pyodata for example only as metadata validator - therefore logically out of "service" block since there can be no networking at all, only local XML file parsing.

I should be able to distinguish exceptions that came out during the phase "model building/metadata validation" from phase "runtime exception from model from valid/invalid metadata depeding on set policies".

I should have clear subset of exceptions that can be thrown from metadata validation and if none of that is thrown, I consider the metadata valid.

Other possibility is to have really method for only metadata parsing and validation, and not be hidden under client initialization (in use case when I don't really want to use the generated model to access any data)

pyodata.Client('NOT_VALID', None, metadata=local_metadata, config=custom_config)

phanak-sap avatar Apr 19 '20 21:04 phanak-sap

@filak-sap @phanak-sap If there aren't any further objections should I implement the exception as described in this PR?

mamiksik avatar May 22 '20 13:05 mamiksik

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 05 '20 12:08 CLAassistant