diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 322df42693..b953d8845a 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -922,7 +922,10 @@ struct ShapeRTTI : public boost::static_visitor IfcGeom::BRepElement* brep = kernel.create_brep_for_representation_and_product(ifc_representation, product); if (!brep) { - throw IfcParse::IfcException("Failed to process shape"); + std::ostringstream oss_repr, oss_product; + ifc_representation->toString(oss_repr); + product->toString(oss_product); + throw IfcParse::IfcException("Failed to process shape. Product: " + oss_product.str() + ", representation: " + oss_repr.str()); } if (settings.get().get() == ifcopenshell::geometry::settings::SERIALIZED) { IfcGeom::SerializedElement* serialization = new IfcGeom::SerializedElement(*brep); @@ -952,7 +955,9 @@ struct ShapeRTTI : public boost::static_visitor try { shapes = kernel.convert(instance); } catch (...) { - throw IfcParse::IfcException("Failed to process shape"); + std::ostringstream oss; + instance->toString(oss); + throw IfcParse::IfcException("Failed to process shape. Instance: " + oss.str()); } IfcGeom::Representation::BRep brep(settings, instance->declaration().name(), to_locale_invariant_string(instance->as()->id()), shapes);