Skip to content

Commit

Permalink
webserver.cc: try to pass exception text with 500 errors
Browse files Browse the repository at this point in the history
fixes #14637 -if- the client sends `Accept: application/json`
  • Loading branch information
Habbie committed Sep 13, 2024
1 parent 1c41b7b commit 27ff9f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdns/webserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,12 @@ void WebServer::handleRequest(HttpRequest& req, HttpResponse& resp) const
catch(PDNSException &e) {
SLOG(g_log<<Logger::Error<<req.logprefix<<"HTTP ISE for \""<< req.url.path << "\": Exception: " << e.reason << endl,
log->error(Logr::Error, e.reason, msg, "exception", Logging::Loggable("PDNSException")));
throw HttpInternalServerErrorException();
throw HttpInternalServerErrorException(e.reason);
}
catch(std::exception &e) {
SLOG(g_log<<Logger::Error<<req.logprefix<<"HTTP ISE for \""<< req.url.path << "\": STL Exception: " << e.what() << endl,
log->error(Logr::Error, e.what(), msg, "exception", Logging::Loggable("std::exception")));
throw HttpInternalServerErrorException();
throw HttpInternalServerErrorException(e.what());
}
catch(...) {
SLOG(g_log<<Logger::Error<<req.logprefix<<"HTTP ISE for \""<< req.url.path << "\": Unknown Exception" << endl,
Expand Down

0 comments on commit 27ff9f4

Please sign in to comment.