From ab9459f8b8d3af135fe67b55c4a9adfe9c2dc6e0 Mon Sep 17 00:00:00 2001 From: xmh0511 <970252187@qq.com> Date: Fri, 17 Jan 2020 14:03:45 +0800 Subject: [PATCH] update --- xfinal/connection.hpp | 2 +- xfinal/http_router.hpp | 4 ++-- xfinal/http_server.hpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xfinal/connection.hpp b/xfinal/connection.hpp index 7c97a7e..664b74a 100644 --- a/xfinal/connection.hpp +++ b/xfinal/connection.hpp @@ -486,7 +486,7 @@ namespace xfinal { } void request_error(std::string&& what_error) { - router_.trigger_error(xfinal_exception{ static_cast(what_error) }); + router_.trigger_error(what_error); res_.write_string(std::move(what_error), false, http_status::bad_request); write(); } diff --git a/xfinal/http_router.hpp b/xfinal/http_router.hpp index 4514fe3..920af3b 100644 --- a/xfinal/http_router.hpp +++ b/xfinal/http_router.hpp @@ -309,8 +309,8 @@ namespace xfinal { } } public: - void trigger_error(std::exception const& err) { - utils::messageCenter::get().trigger_message(err.what()); + void trigger_error(std::string const& err) { + utils::messageCenter::get().trigger_message(err); } private: void set_view_method(response& res) { diff --git a/xfinal/http_server.hpp b/xfinal/http_server.hpp index 5a17f54..d1d46a6 100644 --- a/xfinal/http_server.hpp +++ b/xfinal/http_server.hpp @@ -68,8 +68,8 @@ namespace xfinal { utils::messageCenter::get().set_handler(event); } - void trigger_error(std::exception const& ec) { - utils::messageCenter::get().trigger_message(ec.what()); + void trigger_error(std::string const& ec) { + utils::messageCenter::get().trigger_message(ec); } template