From fc6607ce9e887b8b036134e19e23c9cbd56f9ad2 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 deae476a9..e57901a4b 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;