Commit 5f892304 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Improve some error messages.

parent 4a01d20c
......@@ -56,7 +56,8 @@ namespace hpp {
void* library = dlopen(lib.c_str(), RTLD_NOW);
error = dlerror ();
if (error != NULL) {
hppDout (error, "Error loading library " << lib << ": " << error);
throw std::runtime_error ("Error loading library " + lib + ": " +
error);
return false;
}
if (library == NULL) {
......@@ -67,11 +68,13 @@ namespace hpp {
PluginFunction_t function = reinterpret_cast<PluginFunction_t>(dlsym(library, "createProblemSolverPlugin"));
error = dlerror ();
if (error != NULL) {
hppDout (error, "Error loading library " << lib << ":\n" << error);
throw std::runtime_error ("Error loading library " + lib + ": " +
error);
return false;
}
if (function == NULL) {
hppDout (error, "Symbol createProblemSolverPlugin of (correctly loaded) library " << lib << " is NULL.");
throw std::runtime_error ("Symbol createProblemSolverPlugin of "
"(correctly loaded) library " + lib + " is NULL.");
return false;
}
......
......@@ -529,7 +529,7 @@ namespace hpp {
if (robot_)
constraints_->addConstraint (constraint);
else
hppDout (error, "Cannot add constraint while robot is not set");
throw std::logic_error ("Cannot add constraint while robot is not set");
}
void ProblemSolver::resetConstraints ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment