GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

Raise Python error from SerializeToString() for missing required fields. #113

Closed psmskelton closed 1 year ago

psmskelton commented 1 year ago

Improving the debugging capabilities when working with the Python implementation. During conversion from Python Protobuf to C++ Protobuf messages, missing required fields were not reported from the SerializeToString call. Internally, SerializeToString calls FindInitializationErrors upon failure and raises an error. This fetches that error and raises it as a RuntimeError.

While not as nicely formatted as C++ provided by #94, it is an improvement over the previously generic "RuntimeError: Failed to Serialize python protobuf message.".

I also appear to have removed some random blank spaces.

psmskelton commented 1 year ago

@tsaubergine Any problems with this?

tsaubergine commented 1 year ago

Thanks! Sorry for the delay; I've been traveling.