diff --git a/include/aare/to_string.hpp b/include/aare/to_string.hpp index dbb0c09f..547ebc09 100644 --- a/include/aare/to_string.hpp +++ b/include/aare/to_string.hpp @@ -19,7 +19,7 @@ T string_to(const std::string &t, const std::string &unit) { double tval{0}; try { tval = std::stod(t); - } catch (const std::invalid_argument &e) { + } catch (const std::invalid_argument &) { throw std::runtime_error("Could not convert string to time"); } diff --git a/python/src/file.hpp b/python/src/file.hpp index ad303730..030ba181 100644 --- a/python/src/file.hpp +++ b/python/src/file.hpp @@ -144,7 +144,7 @@ void define_file_io_bindings(py::module &m) { self.read_into( reinterpret_cast(image.mutable_data())); return image; - } catch (std::runtime_error &e) { + } catch (std::runtime_error &) { throw py::stop_iteration(); } }); diff --git a/python/src/jungfrau_data_file.hpp b/python/src/jungfrau_data_file.hpp index 0d9c808b..1ff4ff9d 100644 --- a/python/src/jungfrau_data_file.hpp +++ b/python/src/jungfrau_data_file.hpp @@ -101,7 +101,7 @@ void define_jungfrau_data_file_io_bindings(py::module &m) { .def("__next__", [](JungfrauDataFile &self) { try { return read_dat_frame(self); - } catch (std::runtime_error &e) { + } catch (std::runtime_error &) { throw py::stop_iteration(); } }); diff --git a/python/src/raw_sub_file.hpp b/python/src/raw_sub_file.hpp index 5e04674d..da858058 100644 --- a/python/src/raw_sub_file.hpp +++ b/python/src/raw_sub_file.hpp @@ -94,7 +94,7 @@ void define_raw_sub_file_io_bindings(py::module &m) { .def("__next__", [](RawSubFile &self) { try { return read_frame_from_RawSubFile(self); - } catch (std::runtime_error &e) { + } catch (std::runtime_error &) { throw py::stop_iteration(); } }); diff --git a/src/RawMasterFile.cpp b/src/RawMasterFile.cpp index 4259c899..6e86de47 100644 --- a/src/RawMasterFile.cpp +++ b/src/RawMasterFile.cpp @@ -23,7 +23,7 @@ RawFileNameComponents::RawFileNameComponents( try { auto pos = m_base_name.rfind('_'); m_file_index = std::stoi(m_base_name.substr(pos + 1)); - } catch (const std::invalid_argument &e) { + } catch (const std::invalid_argument &) { throw std::runtime_error(LOCATION + "Could not parse file index"); } @@ -370,7 +370,7 @@ void RawMasterFile::parse_json(std::istream &is) { try { m_quad = j.at("Quad"); - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // keep the optional empty } // try{ @@ -384,7 +384,7 @@ void RawMasterFile::parse_json(std::istream &is) { if (digital_flag) { m_digital_samples = j.at("Digital Samples"); } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // keep the optional empty } try { @@ -393,7 +393,7 @@ void RawMasterFile::parse_json(std::istream &is) { if (m_transceiver_flag) { m_transceiver_samples = j.at("Transceiver Samples"); } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // keep the optional empty } try { @@ -414,7 +414,7 @@ void RawMasterFile::parse_json(std::istream &is) { m_scan_parameters .increment_stop(); // adjust for endpoint being included } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // not a scan } try { @@ -424,7 +424,7 @@ void RawMasterFile::parse_json(std::istream &is) { m_udp_port_types.value().push_back( string_to(elem)); } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // leave the optional empty } try { @@ -433,13 +433,13 @@ void RawMasterFile::parse_json(std::istream &is) { for (auto &elem : json_list_obj) { m_disabled_udp_ports.push_back(static_cast(elem)); } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { m_disabled_udp_ports .clear(); // empty list if not present in master file } try { m_udp_interfaces_per_module = {j.at("Number of UDP Interfaces"), 1}; - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { if (m_type == DetectorType::Eiger && m_quad == 1) m_udp_interfaces_per_module = {2, 1}; else if (m_type == DetectorType::Eiger) { @@ -485,7 +485,7 @@ void RawMasterFile::parse_json(std::istream &is) { } } - } catch (const json::out_of_range &e) { + } catch (const json::out_of_range &) { // fill ROI with full detector size if not present in master file m_rois.push_back( {0, m_detector_layout.col * static_cast(m_pixels_x), 0,