Skip to content

Commit

Permalink
fix: main loop error route
Browse files Browse the repository at this point in the history
  • Loading branch information
ak0327 committed Mar 8, 2024
1 parent cce610d commit 593fcdb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions srcs/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ ServerResult Server::run() {
ServerResult fd_ready_result = this->fds_->get_io_ready_fd();
if (fd_ready_result.is_err()) {
const std::string error_msg = fd_ready_result.err_value();
return ServerResult::err(error_msg);
std::cerr << "error: " << error_msg << std::endl;
continue;
// return ServerResult::err(error_msg);
}
int ready_fd = fd_ready_result.ok_value();
if (ready_fd == IO_TIMEOUT) {
Expand All @@ -280,7 +282,8 @@ ServerResult Server::run() {
ServerResult event_result = process_event(ready_fd);
if (event_result.is_err()) {
const std::string error_msg = event_result.err_value();
return ServerResult::err(error_msg);
std::cerr << "error: " << error_msg << std::endl;
// return ServerResult::err(error_msg);
}
}
return ServerResult::ok(OK);
Expand Down

0 comments on commit 593fcdb

Please sign in to comment.