Skip to content

Commit

Permalink
Merge pull request redpanda-data#7555 from BenPope/schema-registry-mi…
Browse files Browse the repository at this point in the history
…ssing-schemas-is-500

schema_registry: If _schemas is missing return 500
  • Loading branch information
BenPope committed Nov 29, 2022
2 parents 0269eb2 + 7b1d908 commit e824d1f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/v/pandaproxy/schema_registry/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@ class wrap {

auto units = co_await _os();
auto guard = gate_guard(_g);
co_return co_await _h(std::move(rq), std::move(rp));
try {
co_return co_await _h(std::move(rq), std::move(rp));
} catch (kafka::client::partition_error const& ex) {
if (
ex.error == kafka::error_code::unknown_topic_or_partition
&& ex.tp.topic == model::schema_registry_internal_tp.topic) {
throw exception(
kafka::error_code::unknown_server_error,
"_schemas topic does not exist");
}
throw;
}
}

private:
Expand Down

0 comments on commit e824d1f

Please sign in to comment.