Skip to content

Commit 0915ad3

Browse files
committed
Improve logging when error occurs while changing folder permissions.
Signed-off-by: Camila Ayres <[email protected]>
1 parent bb69609 commit 0915ad3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/libsync/filesystem.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,17 @@ bool FileSystem::setFolderPermissions(const QString &path,
344344
}
345345
catch (const std::filesystem::filesystem_error &e)
346346
{
347-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
347+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
348348
return false;
349349
}
350350
catch (const std::system_error &e)
351351
{
352-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
352+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << stdStrPath;
353353
return false;
354354
}
355355
catch (...)
356356
{
357-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
357+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << stdStrPath;
358358
return false;
359359
}
360360

@@ -494,12 +494,12 @@ bool FileSystem::setFolderPermissions(const QString &path,
494494
}
495495
catch (const std::system_error &e)
496496
{
497-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
497+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << stdStrPath;
498498
return false;
499499
}
500500
catch (...)
501501
{
502-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
502+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << stdStrPath;
503503
return false;
504504
}
505505

@@ -516,17 +516,17 @@ bool FileSystem::isFolderReadOnly(const std::filesystem::path &path) noexcept
516516
}
517517
catch (const std::filesystem::filesystem_error &e)
518518
{
519-
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
519+
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
520520
return false;
521521
}
522522
catch (const std::system_error &e)
523523
{
524-
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what();
524+
qCWarning(lcFileSystem()) << "exception when checking folder permissions" << e.what() << "- path:" << path;
525525
return false;
526526
}
527527
catch (...)
528528
{
529-
qCWarning(lcFileSystem()) << "exception when checking folder permissions";
529+
qCWarning(lcFileSystem()) << "exception when checking folder permissions - path:" << path;
530530
return false;
531531
}
532532
}
@@ -545,15 +545,15 @@ FileSystem::FilePermissionsRestore::FilePermissionsRestore(const QString &path,
545545
}
546546
catch (const std::filesystem::filesystem_error &e)
547547
{
548-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << e.path1().c_str() << e.path2().c_str();
548+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path1:" << e.path1().c_str() << "- path2:" << e.path2().c_str();
549549
}
550550
catch (const std::system_error &e)
551551
{
552-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what();
552+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions" << e.what() << "- path:" << path;
553553
}
554554
catch (...)
555555
{
556-
qCWarning(lcFileSystem()) << "exception when modifying folder permissions";
556+
qCWarning(lcFileSystem()) << "exception when modifying folder permissions - path:" << path;
557557
}
558558
}
559559

0 commit comments

Comments
 (0)