diff --git a/include/ircd/json/json.h b/include/ircd/json/json.h index ccca45107..4381b5345 100644 --- a/include/ircd/json/json.h +++ b/include/ircd/json/json.h @@ -21,6 +21,7 @@ namespace ircd::json IRCD_EXCEPTION(error, type_error); IRCD_EXCEPTION(error, not_found); IRCD_EXCEPTION(parse_error, recursion_limit); + struct expectation_failure; struct value; struct member; diff --git a/ircd/client.cc b/ircd/client.cc index 7c4580c31..3158155b6 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -572,18 +572,19 @@ catch(const boost::system::system_error &e) close(net::dc::RST, net::close_ignore); return false; } +#ifndef RB_DEBUG catch(const std::exception &e) { - log::error("client[%s] [500 Internal Error]: %s", - string(remote(*this)), - e.what()); + log::error + { + "client[%s] [500 Internal Error]: %s" + string(remote(*this)), + e.what()) + }; - #ifdef RB_DEBUG - throw; - #else - return false; - #endif + return false; } +#endif /// Handle a single request within the client main() loop. /// diff --git a/ircd/json.cc b/ircd/json.cc index f962946ef..267c210d8 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -42,8 +42,6 @@ namespace ircd::json using karma::eps; using karma::attr_cast; - struct expectation_failure; - template struct input; template struct output; diff --git a/ircd/resource.cc b/ircd/resource.cc index 43c9eb8a9..94d1089b0 100644 --- a/ircd/resource.cc +++ b/ircd/resource.cc @@ -321,7 +321,7 @@ catch(const json::not_found &e) { throw m::error { - http::BAD_REQUEST, "M_BAD_JSON", "Required JSON field: %s", e.what() + http::NOT_FOUND, "M_BAD_JSON", "Required JSON field: %s", e.what() }; } catch(const json::print_error &e)