Skip to content
Snippets Groups Projects
Commit eac5143f authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Homogeneize error messages.

parent a9cf7232
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,7 @@ class Entity (object) :
try:
object.__getattr__(self, name)
except AttributeError:
raise AttributeError('Entity named "%s" has no attribute %s\n'%
raise AttributeError("'%s' entity has no attribute %s\n"%
(self.name, name)+
' entity attributes are usually either\n'+
' - commands,\n'+
......
......@@ -207,9 +207,10 @@ namespace dynamicgraph {
entity->getNewStyleCommandMap();
if (commandMap.count(std::string(commandName)) != 1) {
std::string msg = "command " + std::string(commandName) +
" is not referenced in Entity " + entity->getName();
PyErr_SetString(dgpyError, msg.c_str());
std::ostringstream oss;
oss << "'" << entity->getName() << "' entity has no command '"
<< commandName << "'.";
PyErr_SetString(PyExc_AttributeError, oss.str().c_str());
return NULL;
}
Command* command = commandMap[std::string(commandName)];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment