From 42c881fd93ab45b0de85fac5c8e9ad0ca679777a Mon Sep 17 00:00:00 2001 From: Georg Dorndorf Date: Wed, 14 Aug 2024 12:08:59 +0200 Subject: [PATCH 1/3] Add missing throws documentation rosbag_cpp writer open #1788 Document that open() may throw. Signed-off-by: Georg Dorndorf --- rosbag2_cpp/include/rosbag2_cpp/writer.hpp | 12 ++++++++++++ .../rosbag2_cpp/writers/sequential_writer.hpp | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/rosbag2_cpp/include/rosbag2_cpp/writer.hpp b/rosbag2_cpp/include/rosbag2_cpp/writer.hpp index c2597f9b0..502ddcbc8 100644 --- a/rosbag2_cpp/include/rosbag2_cpp/writer.hpp +++ b/rosbag2_cpp/include/rosbag2_cpp/writer.hpp @@ -74,6 +74,12 @@ class ROSBAG2_CPP_PUBLIC Writer * more storage and converter options. * * \param storage_uri URI of the storage to open. + * \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 std::string & uri); @@ -83,6 +89,12 @@ class ROSBAG2_CPP_PUBLIC Writer * * \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, diff --git a/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp b/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp index fd9aae481..a5b6cd903 100644 --- a/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp +++ b/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp @@ -77,6 +77,12 @@ class ROSBAG2_CPP_PUBLIC SequentialWriter * * \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, From 64d2513344fe204b0f0459acd341570d0e872dc6 Mon Sep 17 00:00:00 2001 From: Georg Dorndorf Date: Mon, 19 Aug 2024 09:50:56 +0200 Subject: [PATCH 2/3] Update rosbag2_cpp writer open documentation Remove documentation of implementation specific throw behaviour Co-authored-by: Tomoya Fujita Signed-off-by: Georg Dorndorf --- rosbag2_cpp/include/rosbag2_cpp/writer.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rosbag2_cpp/include/rosbag2_cpp/writer.hpp b/rosbag2_cpp/include/rosbag2_cpp/writer.hpp index 502ddcbc8..a716d4d74 100644 --- a/rosbag2_cpp/include/rosbag2_cpp/writer.hpp +++ b/rosbag2_cpp/include/rosbag2_cpp/writer.hpp @@ -74,12 +74,7 @@ class ROSBAG2_CPP_PUBLIC Writer * more storage and converter options. * * \param storage_uri URI of the storage to open. - * \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. + * \throws runtime_error if internal error happens. **/ void open(const std::string & uri); From d71631378ee824a849ac3f266afb813459867498 Mon Sep 17 00:00:00 2001 From: Georg Dorndorf Date: Mon, 19 Aug 2024 09:51:30 +0200 Subject: [PATCH 3/3] Update rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp Fix documentation intendation Co-authored-by: Tomoya Fujita Signed-off-by: Georg Dorndorf --- .../include/rosbag2_cpp/writers/sequential_writer.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp b/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp index a5b6cd903..ac8248088 100644 --- a/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp +++ b/rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp @@ -77,12 +77,10 @@ class ROSBAG2_CPP_PUBLIC SequentialWriter * * \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. + * \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,