From 680fd93d3e565f6d33dabb20d3a0de101169273e Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 26 Mar 2026 14:58:26 +0100 Subject: [PATCH] fixed error messages --- slsDetectorSoftware/src/Detector.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 089e2e7b0..a6bd47a2f 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -2403,8 +2403,9 @@ defs::dacIndex Detector::getDacIndex(const std::string &name) const { auto retval = StringTo(name); auto list = getDacList(); if (std::find(list.begin(), list.end(), retval) == list.end()) { - throw RuntimeError("Dac name not found in dac list. Use 'daclist' to " - "get the list of dac names for this detector."); + throw RuntimeError("Dac name not found in dac list. Use 'daclist' or " + "Detector::getDacNames() to get the list of dac " + "names for this detector."); } return retval; } @@ -2418,8 +2419,10 @@ std::string Detector::getDacName(const defs::dacIndex i) const { return pimpl->getCtbDacName(i); auto list = getDacList(); if (std::find(list.begin(), list.end(), i) == list.end()) { - throw RuntimeError("Dac index not found in dac list. Use 'daclist' to " - "get the list of dac indices for this detector."); + auto count = getDacList().size(); + throw RuntimeError( + "Dac index not found in dac list. Use an index from 0 to " + + std::to_string(count - 1) + "."); } return ToString(i); }