From 727a29600d9cf21fac4784523e3fb4c4cc233406 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Sat, 19 Apr 2014 13:19:48 +0200 Subject: [PATCH] better error messages for extractor Previously extractor would just crash because of unhandled exceptions. Now it displays meaningful error messages. --- extractor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extractor.cpp b/extractor.cpp index deae476a928..e57901a4b2f 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -132,6 +132,16 @@ int main (int argc, char *argv[]) { return -1; } + if(!boost::filesystem::is_regular_file(input_path)) { + SimpleLogger().Write(logWARNING) << "Input file " << input_path.c_str() << " not found!"; + return -1; + } + + if(!boost::filesystem::is_regular_file(profile_path)) { + SimpleLogger().Write(logWARNING) << "Profile " << profile_path.c_str() << " not found!"; + return -1; + } + SimpleLogger().Write() << "Input file: " << input_path.filename().string(); SimpleLogger().Write() << "Profile: " << profile_path.filename().string(); SimpleLogger().Write() << "Threads: " << requested_num_threads;