From 34a6dd7604a0c58600664eef50dafeaacf0c14f1 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 9 May 2016 17:35:17 +0200 Subject: [PATCH] dnsdist: Log the content of webserver's exceptions --- pdns/dnsdist-web.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 52f171961..0699f14b0 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -400,12 +400,16 @@ static void connectionThread(int sock, ComboAddress remote, string password, str fclose(fp); fp=0; } - catch(...) - { - errlog("Webserver thread died with exception"); - if(fp) - fclose(fp); - } + catch(const std::exception& e) { + errlog("Webserver thread died with exception: %s", e.what()); + if(fp) + fclose(fp); + } + catch(...) { + errlog("Webserver thread died with exception"); + if(fp) + fclose(fp); + } } void dnsdistWebserverThread(int sock, const ComboAddress& local, const std::string& password, const std::string& apiKey, const boost::optional >& customHeaders) { -- 2.40.0