Skip to content

Commit

Permalink
Detect IO error in load
Browse files Browse the repository at this point in the history
  • Loading branch information
rimms committed Feb 28, 2014
1 parent da67929 commit 5c2c2c0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jubatus/server/framework/server_base.cpp
Expand Up @@ -58,8 +58,16 @@ void load_file_impl(server_base& server,
<< core::common::exception::error_errno(errno));
}

framework::load_server(ifs, server, id);
ifs.close();
ifs.exceptions(std::ios_base::failbit | std::ios_base::badbit);
try {
framework::load_server(ifs, server, id);
ifs.close();
} catch (const std::ios_base::failure&) {
throw JUBATUS_EXCEPTION(
core::common::exception::runtime_error("cannot read output file")

This comment has been minimized.

Copy link
@kmaehashi

kmaehashi Mar 6, 2014

This should be "input file" instead of "output file".

This comment has been minimized.

Copy link
@rimms

rimms Mar 6, 2014

Author Owner

I fixed in 396e189.

<< core::common::exception::error_file_name(path)
<< core::common::exception::error_errno(errno));
}

server.update_loaded_status(path);
LOG(INFO) << "loaded from " << path;
Expand Down

0 comments on commit 5c2c2c0

Please sign in to comment.