Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xmh0511 committed Jan 17, 2020
1 parent 368e386 commit ab9459f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion xfinal/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ namespace xfinal {
}

void request_error(std::string&& what_error) {
router_.trigger_error(xfinal_exception{ static_cast<std::string const&>(what_error) });
router_.trigger_error(what_error);
res_.write_string(std::move(what_error), false, http_status::bad_request);
write();
}
Expand Down
4 changes: 2 additions & 2 deletions xfinal/http_router.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions xfinal/http_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename T = default_session_storage>
Expand Down

0 comments on commit ab9459f

Please sign in to comment.