microavia / messgen

MIT License
9 stars 11 forks source link

Obscure error messages when dir/proto not found #55

Closed Roman- closed 1 year ago

Roman- commented 1 year ago

When you execute this command

python3 generate.py -b ./base_dir -m my_vendor/my_protocol -l cpp -o out/cpp

and some dir not found (base_dir/my_vendor/my_protocol), this is the output:

Traceback (most recent call last):
  File "/tmp/test/messgen/generate.py", line 148, in <module>
    main()
  File "/tmp/test/messgen/generate.py", line 132, in main
    data_types_map = data_types_preprocessor.create_types_map(modules_map)
  File "/tmp/test/messgen/messgen/data_types_preprocessor.py", line 60, in create_types_map
    self.__create_lookup_messages_set(modules_map)
  File "/tmp/test/messgen/messgen/data_types_preprocessor.py", line 85, in __create_lookup_messages_set
    if module["proto_id"] >= self.MAX_PROTO_ID:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

This traceback does not reveal any information regarding what may be the cause of the problem.

Furthermore, it will be nice to also output a success message if the generation is completed successfully.