Changed error handling for debugging

This commit is contained in:
crowning- 2015-04-11 15:23:33 +02:00
parent 2b040d1e48
commit 7b8e729cb0

View File

@ -723,11 +723,10 @@ bool AppInit2(boost::thread_group& threadGroup)
if(GetBoolArg("-createwalletbackups", true)) if(GetBoolArg("-createwalletbackups", true))
{ {
if (!filesystem::exists(backupDir))
filesystem::create_directories(backupDir);
// Create backup of the wallet // Create backup of the wallet
if (filesystem::exists(backupDir)) if (filesystem::exists(backupDir))
{ {
// boost::system::error_code error;
std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H.%M", GetTime()); std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H.%M", GetTime());
std::string backupDirStr = backupDir.string(); std::string backupDirStr = backupDir.string();
backupDirStr += "/" + strWalletFile; backupDirStr += "/" + strWalletFile;
@ -739,7 +738,7 @@ bool AppInit2(boost::thread_group& threadGroup)
boost::filesystem::copy_file(sourceFile, backupFile); boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile); LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch(boost::filesystem::filesystem_error &error) { } catch(boost::filesystem::filesystem_error &error) {
LogPrintf("Failed to create backup %s -> %s\n", sourceFile, backupFile); LogPrintf("Failed to create backup %s\n", &error);
} }
} }
} }