summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/VCards/VCardFileStorage.cpp')
-rw-r--r--Swiften/VCards/VCardFileStorage.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Swiften/VCards/VCardFileStorage.cpp b/Swiften/VCards/VCardFileStorage.cpp
index 66bae04..b4536f9 100644
--- a/Swiften/VCards/VCardFileStorage.cpp
+++ b/Swiften/VCards/VCardFileStorage.cpp
@@ -39,7 +39,12 @@ boost::shared_ptr<VCard> VCardFileStorage::getVCard(const JID& jid) const {
void VCardFileStorage::setVCard(const JID& jid, boost::shared_ptr<VCard> v) {
boost::filesystem::path vcardPath(getVCardPath(jid));
if (!boost::filesystem::exists(vcardPath.parent_path())) {
- boost::filesystem::create_directories(vcardPath.parent_path());
+ try {
+ boost::filesystem::create_directories(vcardPath.parent_path());
+ }
+ catch (const boost::filesystem::filesystem_error& e) {
+ std::cerr << "ERROR: " << e.what() << std::endl;
+ }
}
boost::filesystem::ofstream file(getVCardPath(jid));
file << VCardSerializer().serializePayload(v);