From 70ce7c23ba8294fd3a7151c7af60d7d3d34ad47a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 7 Jan 2004 02:45:03 +0000 Subject: [PATCH] *** empty log message *** --- examples/client_test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 366d22db1..806ef8068 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -204,10 +204,16 @@ int main(int argc, char* argv[]) torrent_info t(e); t.print(std::cout); - std::ifstream resume_file("test.fastresume", std::ios_base::binary); - resume_file.unsetf(std::ios_base::skipws); - entry resume_data = bdecode(std::istream_iterator(resume_file) - , std::istream_iterator()); + entry resume_data; + try + { + std::ifstream resume_file("test.fastresume", std::ios_base::binary); + resume_file.unsetf(std::ios_base::skipws); + resume_data = bdecode(std::istream_iterator(resume_file) + , std::istream_iterator()); + } + catch (invalid_encoding&) + {} handles.push_back(ses.add_torrent(t, "", resume_data)); handles.back().set_max_uploads(40);