rcasteran / jarvis4se

JARVIS for Systems Engineers
https://regis-casteran.gitbook.io/jarvis4se/
MIT License
3 stars 1 forks source link

Handling unknown type #69

Closed rcasteran closed 1 year ago

rcasteran commented 1 year ago

Impacted version jarvis4se version: 1.3.2

Describe the bug Jarvis does not handle unknown types correctly and in a consistent manner.

To Reproduce Execute the following commands:

%%jarvis
with test
F1 is a safety function

Jarvis will display a message "Creating test.xml !" and nothing more. The xml file is created with the default structure but without a function "F1" of type "safety function".

And then the following ones:

%%jarvis
with test
a is a flow

Now an AttributeError is displayed: File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\jarvis\shared_orchestrator.py:1244, in get_base_type_recursively(obj_type) 1242 if isinstance(obj_type, datamodel.BaseType): 1243 return obj_type -> 1244 elif obj_type.name in [str(i) for i in datamodel.BaseType]: 1245 return obj_type.name 1246 elif obj_type.base in [str(i) for i in datamodel.BaseType]:

AttributeError: 'NoneType' object has no attribute 'name'

Expected behavior Jarvis shall display a correct error message when trying to create an element with an unknown type, whatever the xml file already exists or not.

Screenshots None

Desktop (please complete the following information):