Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing throws documentation to rosbag_cpp writer open() #1788 #1789

Open
wants to merge 3 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions rosbag2_cpp/include/rosbag2_cpp/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
gDorndorf marked this conversation as resolved.
Show resolved Hide resolved
**/
void open(const std::string & uri);

Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions rosbag2_cpp/include/rosbag2_cpp/writers/sequential_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we want to list the all possible exception here, but at least indent is needed as below.

Suggested change
* \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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that introduces some maintenance hazard keeping doc and implementation in sync, but it could be practical to have it there.

I'd also be fine with just a hint at some general throw behavior here.
So I'd leave it up to any reviewer as I am not too familiar with the style use throughout the rest of the codebase.

**/
void open(
const rosbag2_storage::StorageOptions & storage_options,
Expand Down