stonier / ecl_core

A set of tools and interfaces extending the capabilities of c++ to provide a lightweight, consistent interface with a focus for control programming.
Other
84 stars 68 forks source link

Exceptions for ecl::Serial seem to be empty #92

Closed clalancette closed 4 years ago

clalancette commented 4 years ago

I'm currently running the kobuki_version_info binary from https://github.com/yujinrobot/kobuki_core/blob/7148901b01da56821c17bf74c26ca7cc52cff593/kobuki_driver/src/tools/version_info.cpp . If I don't have permissions to access the /dev/kobuki serial device, for instance, I expect the program to fail with an error. It does fail, but gives me the following:

Version Info:
terminate called after throwing an instance of 'ecl::StandardException'
  what():  
Aborted (core dumped)

This should have more detailed information (like the device it was trying to open, and the string "Permission denied").

Looking at it a bit, it looks like most of the low-level code is doing the right thing. https://github.com/stonier/ecl_core/blob/19b9ab7bddb43975f71e81e82fd79ff8a01d2aab/ecl_devices/src/lib/serial_pos.cpp#L114 is the open, followed immediately by a call to open_exception on failure. https://github.com/stonier/ecl_core/blob/19b9ab7bddb43975f71e81e82fd79ff8a01d2aab/ecl_devices/src/lib/detail/exception_handler_pos.cpp#L44 should be filling in the correct error message, but it seems like the low-level StandardException isn't working as expected. I left off the investigation there.