mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 06:52:03 +08:00
Pass exceptions by reference (fixes warnings)
This commit is contained in:
parent
97522955a9
commit
dc48ebea78
@ -63,7 +63,7 @@ Config::validate()
|
|||||||
ConfigOptionVectorBase* tmp_opt;
|
ConfigOptionVectorBase* tmp_opt;
|
||||||
try {
|
try {
|
||||||
tmp_opt = get_ptr<ConfigOptionVectorBase>(k);
|
tmp_opt = get_ptr<ConfigOptionVectorBase>(k);
|
||||||
} catch (std::bad_cast) {
|
} catch (std::bad_cast& e) {
|
||||||
throw InvalidOptionType((std::string("(cast failure) Invalid value for ") + std::string(k)).c_str());
|
throw InvalidOptionType((std::string("(cast failure) Invalid value for ") + std::string(k)).c_str());
|
||||||
}
|
}
|
||||||
auto tmp_str {tmp_opt->vserialize()};
|
auto tmp_str {tmp_opt->vserialize()};
|
||||||
@ -140,9 +140,9 @@ Config::set(const t_config_option_key& opt_key, const std::string& value)
|
|||||||
default:
|
default:
|
||||||
Slic3r::Log::warn("Config::set", "Unknown set type.");
|
Slic3r::Log::warn("Config::set", "Unknown set type.");
|
||||||
}
|
}
|
||||||
} catch (std::invalid_argument e) {
|
} catch (std::invalid_argument& e) {
|
||||||
throw InvalidOptionValue(std::string(opt_key) + std::string(" set with invalid value."));
|
throw InvalidOptionValue(std::string(opt_key) + std::string(" set with invalid value."));
|
||||||
} catch (std::out_of_range e) {
|
} catch (std::out_of_range& e) {
|
||||||
throw InvalidOptionType(std::string(opt_key) + std::string(" is an invalid Slic3r option."));
|
throw InvalidOptionType(std::string(opt_key) + std::string(" is an invalid Slic3r option."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user