From 72d3f4896a46a9b820fbb6955d738fac0f31b371 Mon Sep 17 00:00:00 2001 From: Kai Aoki Date: Tue, 12 Jul 2022 00:10:57 +0900 Subject: [PATCH] Update httplib.h use std::exception_ptr --- httplib.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;