Skip to content

Commit d1be0e8

Browse files
committed
create_shape - raise the same error for representations and rep items
To be consistent with how it's handled when product+representation is passed, previously it would fail silently.
1 parent dcc568f commit d1be0e8

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/ifcgeom/Converter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ IfcGeom::ConversionResults ifcopenshell::geometry::Converter::convert(IfcUtil::I
389389
IfcGeom::ConversionResults results;
390390
if (geom_item) {
391391
std::clock_t geom_start = std::clock();
392-
kernel_->convert(geom_item, results);
392+
if (!kernel_->convert(geom_item, results)) {
393+
throw std::runtime_error("Failed to convert item");
394+
}
393395
std::clock_t geom_end = std::clock();
394396
total_map_time += (geom_start - map_start) / (double) CLOCKS_PER_SEC;
395397
total_geom_time += (geom_end - geom_start) / (double) CLOCKS_PER_SEC;

src/ifcwrap/IfcGeomWrapper.i

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,12 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
844844
// https://github.com/IfcOpenShell/IfcOpenShell/issues/1649
845845
instance->declaration().is(Schema::IfcProfileDef::Class())
846846
) {
847-
IfcGeom::ConversionResults shapes = kernel.convert(instance);
847+
IfcGeom::ConversionResults shapes;
848+
try {
849+
shapes = kernel.convert(instance);
850+
} catch (...) {
851+
throw IfcParse::IfcException("Failed to process shape");
852+
}
848853

849854
IfcGeom::Representation::BRep brep(settings, instance->declaration().name(), to_locale_invariant_string(instance->data().id()), shapes);
850855
try {

0 commit comments

Comments
 (0)