1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-27 21:47:39 +00:00

Avoid throwing exceptions from destructors

Detected by clang-tidy check bugprone-exception-escape
This commit is contained in:
Carles Fernandez
2019-02-10 21:55:51 +01:00
parent 75bd492d96
commit 4b2b205e21
36 changed files with 897 additions and 373 deletions

View File

@@ -58,6 +58,7 @@
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <cmath>
#include <exception>
#include <iostream>
#include <numeric>
#include <sstream>
@@ -672,7 +673,14 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking()
}
if (d_dump_mat)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
}
try
{

View File

@@ -54,6 +54,7 @@
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <cmath>
#include <exception>
#include <iostream>
#include <sstream>
@@ -621,7 +622,14 @@ dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
}
if (d_dump_mat)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
}
try
{

View File

@@ -49,6 +49,7 @@
#include <pmt/pmt.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -325,7 +326,14 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c
{
std::cout << "Writing .mat files ...";
}
glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -48,6 +48,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -528,7 +529,15 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s
{
std::cout << "Writing .mat files ...";
}
glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -47,6 +47,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -278,7 +279,15 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile();
try
{
Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -47,6 +47,7 @@
#include <pmt/pmt.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -322,7 +323,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::~glonass_l2_ca_dll_pll_c_aid_tracking_c
{
std::cout << "Writing .mat files ...";
}
glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -46,6 +46,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -527,7 +528,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s
{
std::cout << "Writing .mat files ...";
}
glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -47,6 +47,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -278,7 +279,15 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::~Glonass_L2_Ca_Dll_Pll_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile();
try
{
Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -40,6 +40,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -304,7 +305,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc()
{
std::cout << "Writing .mat files ...";
}
gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -40,6 +40,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -305,7 +306,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc()
{
std::cout << "Writing .mat files ...";
}
gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -48,6 +48,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@@ -374,7 +375,15 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Gps_L1_Ca_Kf_Tracking_cc::save_matfile();
try
{
Gps_L1_Ca_Kf_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@@ -47,6 +47,7 @@
#include <gnuradio/io_signature.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <sstream>
#include <utility>