@@ -539,12 +539,6 @@ std::vector<std::variant<DescriptorItem, DataError>> LocalVersionedEngine::batch
539539 const std::vector<StreamId>& stream_ids, const std::vector<VersionQuery>& version_queries,
540540 const BatchReadOptions& batch_read_options
541541) {
542-
543- internal::check<ErrorCode::E_ASSERTION_FAILURE>(
544- batch_read_options.batch_throw_on_error ().has_value (),
545- " ReadOptions::batch_throw_on_error_ should always be set here"
546- );
547-
548542 auto opt_index_key_futs = batch_get_versions_async (store (), version_map (), stream_ids, version_queries);
549543 std::vector<folly::Future<DescriptorItem>> descriptor_futures;
550544 for (auto && [idx, opt_index_key_fut] : folly::enumerate (opt_index_key_futs)) {
@@ -554,7 +548,7 @@ std::vector<std::variant<DescriptorItem, DataError>> LocalVersionedEngine::batch
554548 }
555549 auto descriptors = folly::collectAll (descriptor_futures).get ();
556550 TransformBatchResultsFlags flags;
557- flags.throw_on_error_ = * batch_read_options.batch_throw_on_error ();
551+ flags.throw_on_error_ = batch_read_options.batch_throw_on_error ();
558552 return transform_batch_items_or_throw (std::move (descriptors), stream_ids, flags, version_queries);
559553}
560554
@@ -1295,11 +1289,6 @@ std::vector<std::variant<ReadVersionOutput, DataError>> LocalVersionedEngine::ba
12951289 if (stream_ids.empty ()) {
12961290 return {};
12971291 }
1298- // This read option should always be set when calling batch_read
1299- internal::check<ErrorCode::E_ASSERTION_FAILURE>(
1300- batch_read_options.batch_throw_on_error ().has_value (),
1301- " ReadOptions::batch_throw_on_error_ should always be set here"
1302- );
13031292 auto opt_index_key_futs = batch_get_versions_async (store (), version_map (), stream_ids, version_queries);
13041293 std::vector<folly::Future<ReadVersionOutput>> read_versions_futs;
13051294
@@ -1353,7 +1342,7 @@ std::vector<std::variant<ReadVersionOutput, DataError>> LocalVersionedEngine::ba
13531342
13541343 TransformBatchResultsFlags flags;
13551344 flags.convert_no_data_found_to_key_not_found_ = true ;
1356- flags.throw_on_error_ = * batch_read_options.batch_throw_on_error ();
1345+ flags.throw_on_error_ = batch_read_options.batch_throw_on_error ();
13571346 return transform_batch_items_or_throw (std::move (all_results), stream_ids, flags, version_queries);
13581347}
13591348
@@ -2085,11 +2074,6 @@ std::vector<std::variant<std::pair<VariantKey, std::optional<google::protobuf::A
20852074 const std::vector<StreamId>& stream_ids, const std::vector<VersionQuery>& version_queries,
20862075 const BatchReadOptions& batch_read_options
20872076 ) {
2088- // This read option should always be set when calling batch_read_metadata
2089- internal::check<ErrorCode::E_ASSERTION_FAILURE>(
2090- batch_read_options.batch_throw_on_error ().has_value (),
2091- " ReadOptions::batch_throw_on_error_ should always be set here"
2092- );
20932077 auto opt_index_key_futs = batch_get_versions_async (store (), version_map (), stream_ids, version_queries);
20942078 std::vector<folly::Future<std::pair<VariantKey, std::optional<google::protobuf::Any>>>> metadata_futures;
20952079 for (auto && [idx, opt_index_key_fut] : folly::enumerate (opt_index_key_futs)) {
@@ -2102,7 +2086,7 @@ std::vector<std::variant<std::pair<VariantKey, std::optional<google::protobuf::A
21022086 // For legacy reason read_metadata_batch is not throwing if the symbol is missing
21032087 TransformBatchResultsFlags flags;
21042088 flags.throw_on_missing_symbol_ = false ;
2105- flags.throw_on_error_ = * batch_read_options.batch_throw_on_error ();
2089+ flags.throw_on_error_ = batch_read_options.batch_throw_on_error ();
21062090 return transform_batch_items_or_throw (std::move (metadatas), stream_ids, flags, version_queries);
21072091}
21082092
0 commit comments