diff --git a/replica/table.cc b/replica/table.cc index 376aa09baa..db0215b607 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -4409,9 +4409,9 @@ future> table::get_snapshot auto& sd = all_snapshots.at(snapshot_name); sd.total += details.total; sd.live += details.live; - utils::get_local_injector().inject("get_snapshot_details", [&] (auto& handler) -> future<> { + utils::get_local_injector().inject("get_snapshot_details", [] { throw std::runtime_error("Injected exception in get_snapshot_details"); - }).get(); + }); } } return all_snapshots; @@ -4439,9 +4439,9 @@ future table::get_snapshot_details(fs::path snapshot_di auto sd = co_await io_check(file_stat, snapshot_directory, name, follow_symlink::no); auto size = sd.allocated_size; - utils::get_local_injector().inject("per-snapshot-get_snapshot_details", [&] (auto& handler) -> future<> { + utils::get_local_injector().inject("per-snapshot-get_snapshot_details", [] { throw std::runtime_error("Injected exception in per-snapshot-get_snapshot_details"); - }).get(); + }); // The manifest and schema.cql files are the only files expected to be in this directory not belonging to the SSTable. //