summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-17 19:26:21 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-17 19:26:21 (GMT)
commit6fd3078f8f512c74bfc54c3d31d6446098088a69 (patch)
tree5db18c9405c83887142d0dc249236cc8d225378e /Swiften/Application/MacOSX/MacOSXApplication.cpp
parent9e5cc663f5018c03fd2657284dfdd5e522d55cbf (diff)
downloadswift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.zip
swift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.tar.bz2
Catch exceptions from create_dir.
Diffstat (limited to 'Swiften/Application/MacOSX/MacOSXApplication.cpp')
-rw-r--r--Swiften/Application/MacOSX/MacOSXApplication.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Swiften/Application/MacOSX/MacOSXApplication.cpp b/Swiften/Application/MacOSX/MacOSXApplication.cpp
index ca73274..8e9a948 100644
--- a/Swiften/Application/MacOSX/MacOSXApplication.cpp
+++ b/Swiften/Application/MacOSX/MacOSXApplication.cpp
@@ -6,6 +6,8 @@
#include "Swiften/Application/MacOSX/MacOSXApplication.h"
+#include <iostream>
+
namespace Swift {
MacOSXApplication::MacOSXApplication(const String& name) : Application(name) {
@@ -16,7 +18,12 @@ ApplicationMessageDisplay* MacOSXApplication::getApplicationMessageDisplay() {
}
boost::filesystem::path MacOSXApplication::getSettingsDir() const {
- boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getName().getUTF8String());
+ try {
+ boost::filesystem::path result(getHomeDir() / "Library/Application Support" / getName().getUTF8String());
+ }
+ catch (const boost::filesystem::filesystem_error& e) {
+ std::cerr << "ERROR: " << e.what() << std::endl;
+ }
boost::filesystem::create_directory(result);
return result;
}