Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 479011a

Browse files
committedMar 7, 2025·
Do not crash on failed writes but skip the file
Signed-off-by: Tim Clephas <[email protected]>
1 parent 3c6ef95 commit 479011a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ void SequentialWriter::switch_to_next_storage()
333333
metadata_.relative_file_paths.size());
334334
storage_ = storage_factory_->open_read_write(storage_options_);
335335
if (!storage_) {
336-
std::stringstream errmsg;
337-
errmsg << "Failed to rollover bagfile to new file: \"" << storage_options_.uri << "\"!";
338-
339-
throw std::runtime_error(errmsg.str());
336+
ROSBAG2_CPP_LOG_ERROR_STREAM("Failed to rollover bagfile to new file: \"" <<
337+
storage_options_.uri << "\"! Nothing will be written until the next split.");
340338
}
341339

342340
rosbag2_storage::FileInformation file_info{};

0 commit comments

Comments
 (0)
Please sign in to comment.