mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 19:34:34 +00:00
Catch and inform about errors
The changes in how specular roughness and transparency is read in was
done to ensure type safety. If you added
"transparency": "0.8"
to the file, then that would be silently ignored. In the new style, it
instead errors out if the type cannot be converted to a double.
This commit is contained in:
committed by
Thomas Krijnen
parent
7e9e56cd2c
commit
9c1660a84b
@@ -497,9 +497,15 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!default_material_filename.empty()) {
|
||||
IfcGeom::set_default_style(default_material_filename);
|
||||
}
|
||||
if (!default_material_filename.empty()) {
|
||||
try {
|
||||
IfcGeom::set_default_style(default_material_filename);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "[Error] Could not read default material file " << default_material_filename << ":" << std::endl;
|
||||
std::cerr << e.what() << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/// @todo Clean up this filter code further.
|
||||
std::vector<geom_filter> used_filters;
|
||||
|
||||
Reference in New Issue
Block a user