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: auth-4.9.2~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38feb8ae8fcc4f81a1f34e5b3bcbcb2c115e34a5;p=thirdparty%2Fpdns.git webserver.cc: try to pass exception text with 500 errors fixes #14637 -if- the client sends `Accept: application/json` (cherry picked from commit 27ff9f415d5c1431dd78486e691a008f969f5843) --- diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 754484558a..a6685ae251 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<