mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 16:27:54 -06:00
ENH: do not throw exception when data directory creating failed in some cases
if the directory already created by other instance do not throw exception Change-Id: I3ebde1ab62fa85ea946b6aeafc87aa7468327ce6
This commit is contained in:
parent
40b01327a2
commit
5cee2208d7
1 changed files with 9 additions and 4 deletions
|
@ -179,9 +179,14 @@ void PresetBundle::setup_directories()
|
|||
boost::filesystem::path subdir = path;
|
||||
subdir.make_preferred();
|
||||
if (! boost::filesystem::is_directory(subdir) &&
|
||||
! boost::filesystem::create_directory(subdir))
|
||||
! boost::filesystem::create_directory(subdir)) {
|
||||
if (boost::filesystem::is_directory(subdir)) {
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("creating directory %1% failed, maybe created by other instance, go on!")%subdir.string();
|
||||
}
|
||||
else
|
||||
throw Slic3r::RuntimeError(std::string("Unable to create directory ") + subdir.string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// recursively copy all files and dirs in from_dir to to_dir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue