mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Better instance not found error messages
This commit is contained in:
@@ -1806,7 +1806,7 @@ IfcEntityList::ptr IfcFile::entitiesByReference(int t) {
|
|||||||
IfcUtil::IfcBaseClass* IfcFile::entityById(int id) {
|
IfcUtil::IfcBaseClass* IfcFile::entityById(int id) {
|
||||||
entity_by_id_t::const_iterator it = byid.find(id);
|
entity_by_id_t::const_iterator it = byid.find(id);
|
||||||
if (it == byid.end()) {
|
if (it == byid.end()) {
|
||||||
throw IfcException("Entity not found");
|
throw IfcException("Instance #" + boost::lexical_cast<std::string>(id) + " not found");
|
||||||
}
|
}
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
@@ -1814,7 +1814,7 @@ IfcUtil::IfcBaseClass* IfcFile::entityById(int id) {
|
|||||||
IfcSchema::IfcRoot* IfcFile::entityByGuid(const std::string& guid) {
|
IfcSchema::IfcRoot* IfcFile::entityByGuid(const std::string& guid) {
|
||||||
entity_by_guid_t::const_iterator it = byguid.find(guid);
|
entity_by_guid_t::const_iterator it = byguid.find(guid);
|
||||||
if ( it == byguid.end() ) {
|
if ( it == byguid.end() ) {
|
||||||
throw IfcException("Entity not found");
|
throw IfcException("Instance with GlobalId '" + guid + "' not found");
|
||||||
} else {
|
} else {
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user