Follow-up from "Catch the right exception for config errors" - scope problem
The following discussion from !40 (merged) should be addressed:
-
@pzejdl started a discussion: (+2 comments)
Hi Dinyar,
Yes, this is a good point. Also looking at the code now, we should probably move the
catch
much closer to the option parsing, maybe immediately after this line? https://gitlab.cern.ch/scouting-demonstrator/scdaq/-/blob/2bc4b316338292232878b51f67caaca43eb7a6a3/src/scdaq.cc#L150So we don't catch
std::invalid_argument
from somewhere else, not related to the config.Another point is that we need to fix the formatting and indentation, the scdaq.cc somehow got ugly. But this is more a global problem related to other source files as well. Maybe we move this part to the issue.