diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-04 22:22:36 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-04 22:22:36 +0000 |
commit | 0334fad13f0c7566fbb9f8a0829b9c95d861ee57 (patch) | |
tree | f34f7c60f774cf81580d62e44e0ff902eec344f2 /netfs/fuse | |
parent | Scrap the precompiled headers (diff) | |
download | netfs-0334fad13f0c7566fbb9f8a0829b9c95d861ee57.tar.bz2 netfs-0334fad13f0c7566fbb9f8a0829b9c95d861ee57.tar.xz netfs-0334fad13f0c7566fbb9f8a0829b9c95d861ee57.zip |
Improve error handling around unavailable daemonnetfs-1.1.5
Diffstat (limited to 'netfs/fuse')
-rw-r--r-- | netfs/fuse/fuseApp.cpp | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp index d37d40c..4766360 100644 --- a/netfs/fuse/fuseApp.cpp +++ b/netfs/fuse/fuseApp.cpp @@ -23,16 +23,36 @@ NetFS::FuseApp::FuseApp(const Ice::StringSeq & a) : NetFS::FuseApp::~FuseApp() { for (const OpenDirs::value_type & of : openDirs) { - of.second->remote->close(); + try { + of.second->remote->close(); + } + catch (...) { + // Can't do anything useful here + } } for (const OpenFiles::value_type & of : openFiles) { - of.second->remote->close(); + try { + of.second->remote->close(); + } + catch (...) { + // Can't do anything useful here + } } if (volume) { - volume->disconnect(); + try { + volume->disconnect(); + } + catch (...) { + // Can't do anything useful here + } } if (session) { - session->destroy(); + try { + session->destroy(); + } + catch (...) { + // Can't do anything useful here + } } if (ic) { ic->destroy(); @@ -183,18 +203,28 @@ NetFS::FuseApp::onError(const std::exception & e) throw() { if (dynamic_cast<const Ice::SocketException *>(&e) || dynamic_cast<const Ice::TimeoutException *>(&e)) { log(LOG_ERR, e.what()); - verifyConnection(); - connectSession(); - connectToService(); - connectToVolume(); - connectHandles(); - return 0; + try { + verifyConnection(); + connectSession(); + connectToService(); + connectToVolume(); + connectHandles(); + return 0; + } + catch (...) { + return -ENOSYS; + } } if (dynamic_cast<const Ice::RequestFailedException *>(&e)) { - volume = NULL; - connectToVolume(); - connectHandles(); - return 0; + try { + volume = NULL; + connectToVolume(); + connectHandles(); + return 0; + } + catch (...) { + return -ENOSYS; + } } if (dynamic_cast<const NetFS::AuthError *>(&e)) { return -EPERM; |