aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-29 13:35:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-29 13:35:24 +0000
commit3c9f7382f08fef5cd10e32853e76db4ea0306ac9 (patch)
treeb9f3ca559aec432591e7b87a1458a11a58f8eb52
parent628bfe3bdb31b85483d89a21d561bf2273637ff4 (diff)
downloadpaludis-3c9f7382f08fef5cd10e32853e76db4ea0306ac9.tar.gz
paludis-3c9f7382f08fef5cd10e32853e76db4ea0306ac9.tar.xz
Better exception messages
-rw-r--r--paludis/util/fs_entry.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index f71ed2f..b3f6080 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -177,6 +177,8 @@ FSEntry::is_symbolic_link() const
bool
FSEntry::has_permission(const FSUserGroup & user_group, const FSPermission & fs_perm) const
{
+ Context context("When checking permissions on '" + stringify(_path) + "':");
+
_stat();
if (! _exists)
@@ -231,6 +233,8 @@ FSEntry::has_permission(const FSUserGroup & user_group, const FSPermission & fs_
mode_t
FSEntry::permissions() const
{
+ Context context("When fetching permissions for '" + stringify(_path) + "':");
+
_stat();
if (! _exists)
@@ -283,6 +287,8 @@ FSEntry::_stat() const
if (_checked)
return;
+ Context context("When calling stat() on '" + stringify(_path) + "':");
+
_stat_info.reset(new struct stat);
if (0 != lstat(_path.c_str(), _stat_info.get()))
{
@@ -332,6 +338,8 @@ FSEntry::dirname() const
FSEntry
FSEntry::realpath() const
{
+ Context context("When fetching realpath of '" + stringify(_path) + "':");
+
char r[PATH_MAX + 1];
std::memset(r, 0, PATH_MAX + 1);
if (! ::realpath(_path.c_str(), r))