diff --git a/src/ifcopenshell-python/test/fixtures/validate/fail-invalid-entity-in-attribute.ifc b/src/ifcopenshell-python/test/fixtures/validate/fail-invalid-entity-in-attribute.ifc new file mode 100644 index 0000000000..39ec2029e6 --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/validate/fail-invalid-entity-in-attribute.ifc @@ -0,0 +1,10 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2022-10-01T16:31:47',(''),(''),'IfcOpenShell 0.7.0','IfcOpenShell 0.7.0',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCCARTESIANPOINT((5.,5.,nan.)); +ENDSEC; +END-ISO-10303-21; diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 021b9a1099..f1a9237d57 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -726,7 +726,7 @@ void IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::enti context.push(simple_type_instance); simple_type_instance->file_ = this; } catch (IfcException& e) { - Logger::Message(Logger::LOG_ERROR, e.what()); + Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + " at offset " + std::to_string(next.startPos)); // #4070 We didn't actually capture an aggregate entry, undo length increment. return_value--; }