24#include <seastar/util/log.hh>
25#include <seastar/util/modules.hh>
26#include <seastar/http/reply.hh>
27#include <seastar/json/json_elements.hh>
33SEASTAR_MODULE_EXPORT_BEGIN
43 : _msg(msg), _status(status) {
46 virtual const char* what()
const noexcept {
54 virtual const std::string& str()
const {
106 std::string(
"Missing mandatory parameter '") + param +
"'") {
114 std::string(
"Can't read body chunk in a 'chunked' request '") + msg +
"'") {
129 void register_params() {
130 add(&_msg,
"message");
135 set(e.str(), e.status());
139 std::ostringstream exception_description;
140 exception_description << e;
161SEASTAR_MODULE_EXPORT_END
168struct fmt::formatter<
seastar::httpd::base_exception> {
169 constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
171 return fmt::format_to(ctx.out(),
"{} ({})", e.what(), e.status());
Definition: exception.hh:110
Definition: exception.hh:95
Definition: exception.hh:88
Definition: exception.hh:40
Definition: exception.hh:125
Definition: exception.hh:102
Definition: exception.hh:77
Definition: exception.hh:66
Definition: exception.hh:118
Definition: exception.hh:154
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
status_type
Definition: reply.hh:65
@ moved_permanently
moved_permanently
@ internal_server_error
internal_server_error
Definition: json_elements.hh:228
virtual void add(json_base_element *element, std::string name, bool mandatory=false)