Skip to content

Commit

Permalink
Imported error reporting when loading presets with option keys
Browse files Browse the repository at this point in the history
or option values that our poor software does not understand.
This applies to configs added by some forks of slic3r, for example
slic3r++
PrusaSlicer has encountered an error: Failed loading the preset file: #3909
  • Loading branch information
bubnikv committed Mar 25, 2020
1 parent a8f6f29 commit 8d7f88b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libslic3r/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ bool ConfigBase::set_deserialize_nothrow(const t_config_option_key &opt_key_src,
void ConfigBase::set_deserialize(const t_config_option_key &opt_key_src, const std::string &value_src, bool append)
{
if (! this->set_deserialize_nothrow(opt_key_src, value_src, append))
throw BadOptionTypeException("ConfigBase::set_deserialize() failed");
throw BadOptionTypeException((boost::format("ConfigBase::set_deserialize() failed for parameter \"%1%\", value \"%2%\"") % opt_key_src % value_src).str());
}

void ConfigBase::set_deserialize(std::initializer_list<SetDeserializeItem> items)
Expand Down
7 changes: 3 additions & 4 deletions src/libslic3r/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ class NoDefinitionException : public std::runtime_error
class BadOptionTypeException : public std::runtime_error
{
public:
BadOptionTypeException() :
std::runtime_error("Bad option type exception") {}
BadOptionTypeException(const char* message) :
std::runtime_error(message) {}
BadOptionTypeException() : std::runtime_error("Bad option type exception") {}
BadOptionTypeException(const std::string &message) : std::runtime_error(message) {}
BadOptionTypeException(const char* message) : std::runtime_error(message) {}
};

// Type of a configuration value.
Expand Down

0 comments on commit 8d7f88b

Please sign in to comment.