From d6cddd3431b399c8c3715c2ea816433d708e1e46 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 6bba17da..bf384b2d 100644
--- a/src/scdaq.cc
+++ b/src/scdaq.cc
@@ -204,10 +204,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