From 27ff9f415d5c1431dd78486e691a008f969f5843 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 13 Sep 2024 15:46:06 +0200 Subject: [PATCH] webserver.cc: try to pass exception text with 500 errors fixes #14637 -if- the client sends `Accept: application/json` --- pdns/webserver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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<