Skip to content

Commit

Permalink
Merge branch 'gidden-liberr' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz committed May 26, 2014
2 parents b36a2c8 + 276a877 commit a128a34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/unix_helper_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ void DynamicModule::SetConstructor() {
dlsym(module_library_, ctor_name_.c_str());

if (!ctor_) {
std::string err_msg = "Unable to load module constructor: ";
err_msg += dlerror();
throw IOError(err_msg);
std::stringstream ss;
std::string agent = ctor_name_;
agent.erase(0, 9); // len(Construct) == 9
ss << "Could not find agent " << agent << " in module library "
<< path_.c_str() << " (" << dlerror() << ").";
throw IOError(ss.str());
}

dlerror(); // reset errors
Expand Down
9 changes: 6 additions & 3 deletions src/windows_helper_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ void DynamicModule::SetConstructor() {
GetProcAddress(module_library_, ctor_name_.c_str());

if (!ctor_) {
string err_msg = "Unable to load agent constructor: ";
err_msg += GetLastError();
throw IOError(err_msg);
std::stringstream ss;
std::string agent = ctor_name_;
agent.erase(0, 9); // len(Construct) == 9
ss << "Could not find agent " << agent << " in module library "
<< path_.c_str() << " (" << GetLastError() << ").";
throw IOError(ss.str());
}
}

Expand Down

0 comments on commit a128a34

Please sign in to comment.