From: Remi Gacogne Date: Mon, 9 May 2016 15:35:17 +0000 (+0200) Subject: dnsdist: Log the content of webserver's exceptions X-Git-Tag: auth-4.0.0-beta1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34a6dd7604a0c58600664eef50dafeaacf0c14f1;p=thirdparty%2Fpdns.git dnsdist: Log the content of webserver's exceptions --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 52f1719616..0699f14b07 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) {