From 8b0915f8e22d9768c5f0458c80048ee4f847af3f Mon Sep 17 00:00:00 2001 From: Ben Pope Date: Thu, 9 May 2024 15:05:35 +0100 Subject: [PATCH] schema_registry/seq_writer: Avoid unhandled exception Signed-off-by: Ben Pope --- src/v/pandaproxy/schema_registry/seq_writer.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/v/pandaproxy/schema_registry/seq_writer.cc b/src/v/pandaproxy/schema_registry/seq_writer.cc index 0f010b3a1b6eb..a025f462cd5e5 100644 --- a/src/v/pandaproxy/schema_registry/seq_writer.cc +++ b/src/v/pandaproxy/schema_registry/seq_writer.cc @@ -391,10 +391,12 @@ seq_writer::do_delete_subject_impermanent(subject sub, model::offset write_at) { delete_subject_key{.seq{write_at}, .node{_node_id}, .sub{sub}}, delete_subject_value{.sub{sub}}); - auto conf = co_await ss::coroutine::as_future( - _store.get_subject_config_written_at(sub)); - if (!conf.failed()) { - rb(conf.get()); + try { + rb(co_await _store.get_subject_config_written_at(sub)); + } catch (exception const& e) { + if (e.code() != error_code::subject_not_found) { + throw; + } } if (co_await produce_and_apply(write_at, std::move(rb).build())) {