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 f841148 commit a75b113
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ int main() {
return 0;
}

server.on_error([](std::string const& ec) {
std::cout << ec << std::endl;
});

server.router<GET, POST>("/write", [](request& req, response& res) {
auto data = map_from_query<test>(req);
dao_t<mysql> dao;
Expand Down
2 changes: 1 addition & 1 deletion xfinal
8 changes: 8 additions & 0 deletions xmart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ namespace xmart {
server.listen(host, port);
}
r = config_result && orm_result;
#ifdef _ENABLE_XORM_
if (r) {
dao_message::get().set_error_callback([](std::string const& message) {
server.trigger_error(message);
});
}
#endif // #ifdef _ENABLE_XORM_

return server;
}

Expand Down
2 changes: 1 addition & 1 deletion xorm
Submodule xorm updated 2 files
+29 −1 xorm/dao.hpp
+29 −7 xorm/mysql.hpp

0 comments on commit a75b113

Please sign in to comment.