aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-30 12:09:58 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-30 12:09:58 +0000
commita42b13af8771ae1cc19b588543d8c951f59dd2af (patch)
tree9aead2c9d732bc4606bfa7f43ebaffec5b5a0ccd
parentbdf481622dfcbd0738c559942b7ea75b1b3b29b2 (diff)
downloadpaludis-a42b13af8771ae1cc19b588543d8c951f59dd2af.tar.gz
paludis-a42b13af8771ae1cc19b588543d8c951f59dd2af.tar.xz
More helpful error messages for failing to write to a cache file.
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index de564f2..d4eb0a0 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -33,6 +33,8 @@
#include <vector>
#include <functional>
#include <algorithm>
+#include <cstring>
+#include <errno.h>
using namespace paludis;
using namespace paludis::erepository;
@@ -176,9 +178,10 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
_filename.dirname().dirname().mkdir();
_filename.dirname().mkdir();
}
- catch (const FSError &)
+ catch (const FSError & e)
{
- // let the 'if (cache_file)' handle the error
+ Log::get_instance()->message(ll_warning, lc_no_context) << "Couldn't create cache directory: " << e.message();
+ return;
}
std::ostringstream cache;
@@ -265,7 +268,7 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
else
{
Log::get_instance()->message(ll_warning, lc_no_context) << "Couldn't write cache file to '"
- << _filename << "'";
+ << _filename << "': " << std::strerror(errno);
}
}