From edbc39f32fa851ee3315a4ddf18435622af3dd05 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Fri, 19 Sep 2014 10:54:22 +0400 Subject: [PATCH] print error messages --- src/twister.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/twister.cpp b/src/twister.cpp index 0c347f11..c5ffa44e 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -142,6 +142,9 @@ torrent_handle startTorrentUser(std::string const &username, bool following) tparams.save_path= torrentPath.string(); boost::system::error_code ec; boost::filesystem::create_directory(torrentPath, ec); + if (ec) { + fprintf(stderr, "failed to create directory '%s': %s\n", torrentPath.string().c_str(), ec.message().c_str()); + } std::string filename = combine_path(tparams.save_path, to_hex(ih.to_string()) + ".resume"); load_file(filename.c_str(), tparams.resume_data); @@ -269,6 +272,9 @@ void ThreadWaitExtIP() boost::filesystem::path swarmDbPath = GetDataDir() / "swarm" / "db"; boost::filesystem::create_directories(swarmDbPath, ec); + if (ec) { + fprintf(stderr, "failed to create directory '%s': %s\n", swarmDbPath.string().c_str(), ec.message().c_str()); + } m_swarmDb.reset(new CLevelDB(swarmDbPath.string(), 256*1024, false, false)); int listen_port = GetListenPort() + LIBTORRENT_PORT_OFFSET;