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/Unix/UnixApplication.h
parent9e5cc663f5018c03fd2657284dfdd5e522d55cbf (diff)
downloadswift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.zip
swift-contrib-6fd3078f8f512c74bfc54c3d31d6446098088a69.tar.bz2
Catch exceptions from create_dir.
Diffstat (limited to 'Swiften/Application/Unix/UnixApplication.h')
-rw-r--r--Swiften/Application/Unix/UnixApplication.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Swiften/Application/Unix/UnixApplication.h b/Swiften/Application/Unix/UnixApplication.h
index 1c985e8..56ee0ed 100644
--- a/Swiften/Application/Unix/UnixApplication.h
+++ b/Swiften/Application/Unix/UnixApplication.h
@@ -10,6 +10,8 @@
#include "Swiften/Application/Application.h"
#include "Swiften/Application/NullApplicationMessageDisplay.h"
+#include <iostream>
+
namespace Swift {
class UnixApplication : public Application {
public:
@@ -26,7 +28,12 @@ namespace Swift {
boost::filesystem::path getSettingsDir() const {
boost::filesystem::path result(getHomeDir() / ("." + getName().getLowerCase().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;
}