#4101 Handle boost::filesystem's exceptions
parent
479a23af5e
commit
1d40793b17
|
|
@ -110,9 +110,10 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)
|
|||
|
||||
std::vector<std::string> v;
|
||||
|
||||
if (exists(p))
|
||||
boost::system::error_code ec;
|
||||
if (exists(p, ec) && !ec.failed())
|
||||
{
|
||||
if (is_directory(p))
|
||||
if (is_directory(p, ec) && !ec.failed())
|
||||
{
|
||||
boost::filesystem::directory_iterator end_iter;
|
||||
for (boost::filesystem::directory_iterator dir_itr(p);
|
||||
|
|
|
|||
|
|
@ -4780,7 +4780,18 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
|
|||
#else
|
||||
boost::filesystem::path b_path(lastSnapshotDir);
|
||||
#endif
|
||||
if (!boost::filesystem::is_directory(b_path))
|
||||
boost::system::error_code ec;
|
||||
if (!boost::filesystem::is_directory(b_path, ec) || ec.failed())
|
||||
{
|
||||
LLSD args;
|
||||
args["PATH"] = lastSnapshotDir;
|
||||
LLNotificationsUtil::add("SnapshotToLocalDirNotExist", args);
|
||||
resetSnapshotLoc();
|
||||
failure_cb();
|
||||
return;
|
||||
}
|
||||
boost::filesystem::space_info b_space = boost::filesystem::space(b_path, ec);
|
||||
if (ec.failed())
|
||||
{
|
||||
LLSD args;
|
||||
args["PATH"] = lastSnapshotDir;
|
||||
|
|
@ -4789,7 +4800,6 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
|
|||
failure_cb();
|
||||
return;
|
||||
}
|
||||
boost::filesystem::space_info b_space = boost::filesystem::space(b_path);
|
||||
if (b_space.free < image->getDataSize())
|
||||
{
|
||||
LLSD args;
|
||||
|
|
@ -4806,6 +4816,8 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
|
|||
LLNotificationsUtil::add("SnapshotToComputerFailed", args);
|
||||
|
||||
failure_cb();
|
||||
|
||||
// Shouldn't there be a return here?
|
||||
}
|
||||
|
||||
// Look for an unused file name
|
||||
|
|
|
|||
Loading…
Reference in New Issue