From 42c881fd93ab45b0de85fac5c8e9ad0ca679777a Mon Sep 17 00:00:00 2001 From: Georg Dorndorf Date: Wed, 14 Aug 2024 12:08:59 +0200 Subject: [PATCH] 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,