HTTP Request: Log an exception message if an error occurs

This commit is contained in:
Yonas Habteab 2020-07-06 14:28:24 +02:00 committed by Yonas Habteab
parent 04704a49a4
commit 488e6bfb67
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#include "base/logger.hpp"
#include "remote/httphandler.hpp"
#include "remote/httputility.hpp"
#include "base/singleton.hpp"
@ -112,7 +113,10 @@ void HttpHandler::ProcessRequest(
break;
}
}
} catch (const std::exception&) {
} catch (const std::exception& ex) {
Log(LogWarning, "HttpServerConnection")
<< "Error while processing HTTP request: " << ex.what();
processed = false;
}