mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Update httplib.h
use std::exception_ptr
This commit is contained in:
parent
5e6f973b99
commit
72d3f4896a
1 changed files with 3 additions and 2 deletions
|
@ -616,7 +616,7 @@ public:
|
|||
using Handler = std::function<void(const Request &, Response &)>;
|
||||
|
||||
using ExceptionHandler =
|
||||
std::function<void(const Request &, Response &, std::exception &e)>;
|
||||
std::function<void(const Request &, Response &, std::exception_ptr &ep)>;
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue