Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libslic3r/Config.cpp')
-rw-r--r--src/libslic3r/Config.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp
index ee3fda467..f05d35d2d 100644
--- a/src/libslic3r/Config.cpp
+++ b/src/libslic3r/Config.cpp
@@ -827,11 +827,19 @@ ConfigSubstitutions ConfigBase::load(const boost::property_tree::ptree &tree, Fo
{
ConfigSubstitutionContext substitutions_ctxt(compatibility_rule);
for (const boost::property_tree::ptree::value_type &v : tree) {
+ t_config_option_key opt_key = v.first;
try {
- t_config_option_key opt_key = v.first;
this->set_deserialize(opt_key, v.second.get_value<std::string>(), substitutions_ctxt);
} catch (UnknownOptionException & /* e */) {
// ignore
+ } catch (BadOptionValueException & e) {
+ if (compatibility_rule == ForwardCompatibilitySubstitutionRule::Disable)
+ throw e;
+ // log the error
+ const ConfigDef* def = this->def();
+ if (def == nullptr) throw e;
+ const ConfigOptionDef* optdef = def->get(opt_key);
+ substitutions_ctxt.substitutions.emplace_back(optdef, v.second.get_value<std::string>(), ConfigOptionUniquePtr(optdef->default_value->clone()));
}
}
return std::move(substitutions_ctxt.substitutions);