ros2 / rosbag2

Apache License 2.0
273 stars 246 forks source link

Missing "throws" documentation in rosbag2_cpp writer open() #1788

Open gDorndorf opened 1 month ago

gDorndorf commented 1 month ago

Description

The documentation of rosbag2_cpp/include/writer.hpp and rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp are missing an entry that indicates that it may throw.

Missing documentation:

https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/include/rosbag2_cpp/writer.hpp#L78

https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/include/rosbag2_cpp/writer.hpp#L87

Expected Behavior

Something like this in writer.hpp and sequential_writer.hpp:

    *
    * \param storage_options Options to configure the storage
    * \param converter_options options to define in which format incoming messages are stored
+   * \throws runtime_error if 
+   * database directory already exists,
+   * failed to create database directory,
+   * no storage could be initialized,
+   * invalid bag splitting size given,
+   * max cache size less or equal 0 when snapshot mode is enabled.
    **/
   void open(
     const rosbag2_storage::StorageOptions & storage_options,

Actual Behavior

Missing documentation.

Additional context

The instances where it throws are: https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp#L122 https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp#L129 https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp#L135 https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp#L145 https://github.com/ros2/rosbag2/blob/ce918b786095757a458a71b5b36ccdc818851246/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp#L150