diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-08-17 19:26:21 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-08-17 19:26:21 (GMT) |
commit | 6fd3078f8f512c74bfc54c3d31d6446098088a69 (patch) | |
tree | 5db18c9405c83887142d0dc249236cc8d225378e /Swiften/Application/Application.cpp | |
parent | 9e5cc663f5018c03fd2657284dfdd5e522d55cbf (diff) | |
download | swift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.zip swift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.tar.bz2 |
Catch exceptions from create_dir.
Diffstat (limited to 'Swiften/Application/Application.cpp')
-rw-r--r-- | Swiften/Application/Application.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Application/Application.cpp b/Swiften/Application/Application.cpp index 24545cb..d9f4a86 100644 --- a/Swiften/Application/Application.cpp +++ b/Swiften/Application/Application.cpp @@ -6,6 +6,7 @@ #include "Swiften/Application/Application.h" +#include <iostream> #include <boost/filesystem.hpp> #include <stdlib.h> @@ -29,7 +30,12 @@ boost::filesystem::path Application::getAvatarDir() const { boost::filesystem::path Application::getProfileDir(const String& profile) const { boost::filesystem::path result(getHomeDir() / profile.getUTF8String()); - boost::filesystem::create_directory(result); + try { + boost::filesystem::create_directory(result); + } + catch (const boost::filesystem::filesystem_error& e) { + std::cerr << "ERROR: " << e.what() << std::endl; + } return result; } |