From a9c0f2a9e7da886bdf254fa6a8382e4ce9697c1c Mon Sep 17 00:00:00 2001 From: Dinyar Rabady <dinyar.rabady@cern.ch> Date: Fri, 14 Oct 2022 18:11:09 +0200 Subject: [PATCH] Catch the right exception for config errors This originally belonged to #15. --- src/scdaq.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scdaq.cc b/src/scdaq.cc index 122cfe7c..706b7b37 100644 --- a/src/scdaq.cc +++ b/src/scdaq.cc @@ -205,10 +205,10 @@ if(argc < 2){ // utility::report_elapsed_time((tbb::tick_count::now() - mainStartTime).seconds()); return retval; - } catch (std::exception& e) { + } catch (std::invalid_argument& e) { LOG(FATAL) << "Configuration invalid! Error text is \"" << e.what() << "\" Bailing out."; return EX_CONFIG; - } catch(std::exception& e) { + } catch (std::exception& e) { LOG(ERROR) << "Error occurred. error text is: \"" << e.what() << "\""; return 1; } -- GitLab