Skip to content

Commit

Permalink
Merge pull request #7809 from nextcloud/bugfix/perms
Browse files Browse the repository at this point in the history
Adds some extra info when throwing exception with setting folder permissions.
  • Loading branch information
mgallien authored Feb 6, 2025
2 parents ac9af29 + 8542c10 commit c693073
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/libsync/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,17 @@ bool FileSystem::setFolderPermissions(const QString &path,
}
catch (const std::filesystem::filesystem_error &e)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
return false;
}
catch (const std::system_error &e)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << stdStrPath;
return false;
}
catch (...)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << stdStrPath;
return false;
}

Expand Down Expand Up @@ -494,12 +494,12 @@ bool FileSystem::setFolderPermissions(const QString &path,
}
catch (const std::system_error &e)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << stdStrPath;
return false;
}
catch (...)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << stdStrPath;
return false;
}

Expand All @@ -516,17 +516,17 @@ bool FileSystem::isFolderReadOnly(const std::filesystem::path &path) noexcept
}
catch (const std::filesystem::filesystem_error &e)
{
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
return false;
}
catch (const std::system_error &e)
{
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what();
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << "- path:" << path;
return false;
}
catch (...)
{
qCWarning(lcFileSystem()) << "exception when checking folder permissions";
qCWarning(lcFileSystem()) << "exception when checking folder permissions - path:" << path;
return false;
}
}
Expand All @@ -545,15 +545,15 @@ FileSystem::FilePermissionsRestore::FilePermissionsRestore(const QString &path,
}
catch (const std::filesystem::filesystem_error &e)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
}
catch (const std::system_error &e)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << path;
}
catch (...)
{
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << path;
}
}

Expand Down

0 comments on commit c693073

Please sign in to comment.