catch polymorphic exceptions by const reference

This commit is contained in:
Patrick Brosi 2019-02-11 17:55:05 +01:00
parent d995f77b53
commit 1dff5eaf64
2 changed files with 7 additions and 7 deletions

View file

@ -105,7 +105,7 @@ void HttpServer::handle() {
Req req = getReq(connection);
answ = _handler->handle(req, connection);
answ.gzip = gzipSupport(req);
} catch (HttpErr err) {
} catch (const HttpErr& err) {
answ = Answer(err.what(), err.what());
} catch (...) {
// catch everything to make sure the server continues running