From: Peter van Dijk Date: Fri, 13 Sep 2024 13:46:06 +0000 (+0200) Subject: webserver.cc: try to pass exception text with 500 errors X-Git-Tag: rec-5.2.0-alpha1~62^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14670%2Fhead;p=thirdparty%2Fpdns.git webserver.cc: try to pass exception text with 500 errors fixes #14637 -if- the client sends `Accept: application/json` --- diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 8a257c66fe..58fb65c0ff 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -301,12 +301,12 @@ void WebServer::handleRequest(HttpRequest& req, HttpResponse& resp) const catch(PDNSException &e) { SLOG(g_log<error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("PDNSException"))); - throw HttpInternalServerErrorException(); + throw HttpInternalServerErrorException(e.reason); } catch(std::exception &e) { SLOG(g_log<error(Logr::Error, e.what(), msg, "exception", Logging::Loggable("std::exception"))); - throw HttpInternalServerErrorException(); + throw HttpInternalServerErrorException(e.what()); } catch(...) { SLOG(g_log<