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:
Jean Niklas L'orange
2018-10-11 16:07:59 +02:00
committed by Thomas Krijnen
parent 7e9e56cd2c
commit 9c1660a84b
2 changed files with 36 additions and 24 deletions
+9 -3
View File
@@ -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;