- Catch exceptions in initialization
- Show unmount command after successfully mounted
This commit is contained in:
parent
030adc4b89
commit
057113df00
11
src/Cli.cpp
11
src/Cli.cpp
@ -29,6 +29,7 @@
|
||||
|
||||
using namespace cryfs;
|
||||
namespace bf = boost::filesystem;
|
||||
using namespace cpputils::logging;
|
||||
|
||||
using blockstore::ondisk::OnDiskBlockStore;
|
||||
using blockstore::inmemory::InMemoryBlockStore;
|
||||
@ -116,6 +117,7 @@ namespace cryfs {
|
||||
}
|
||||
|
||||
void Cli::_runFilesystem(const ProgramOptions &options) {
|
||||
try {
|
||||
auto blockStore = make_unique_ref<OnDiskBlockStore>(bf::path(options.baseDir()));
|
||||
auto config = _loadOrCreateConfig(options);
|
||||
CryDevice device(std::move(config), std::move(blockStore));
|
||||
@ -123,11 +125,18 @@ namespace cryfs {
|
||||
fspp::fuse::Fuse fuse(&fsimpl);
|
||||
|
||||
_initLogfile(options);
|
||||
|
||||
std::cout << "\nFilesystem is running. To unmount, call:\n$ fusermount -u " << options.mountDir() << "\n" << std::endl;
|
||||
|
||||
_goToBackgroundIfSpecified(options);
|
||||
|
||||
vector<char *> fuseOptions = options.fuseOptions();
|
||||
std::cout << "\nFilesystem is running." << std::endl;
|
||||
fuse.run(fuseOptions.size(), fuseOptions.data());
|
||||
} catch (const std::exception &e) {
|
||||
LOG(ERROR) << "Crashed: " << e.what();
|
||||
} catch (...) {
|
||||
LOG(ERROR) << "Crashed";
|
||||
}
|
||||
}
|
||||
|
||||
void Cli::_goToBackgroundIfSpecified(const ProgramOptions &options) {
|
||||
|
Loading…
Reference in New Issue
Block a user