diff --git a/httplib.h b/httplib.h index 1c4db98..111276a 100644 --- a/httplib.h +++ b/httplib.h @@ -616,7 +616,7 @@ public: using Handler = std::function; using ExceptionHandler = - std::function; + std::function; enum class HandlerResponse { Handled, @@ -5733,7 +5733,8 @@ Server::process_request(Stream &strm, bool close_connection, routed = routing(req, res, strm); } catch (std::exception &e) { if (exception_handler_) { - exception_handler_(req, res, e); + auto ep = std::current_exception(); + exception_handler_(req, res, ep); routed = true; } else { res.status = 500;