mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-30 19:04:51 +00:00
catching exceptions
This commit is contained in:
parent
4bb256cc7d
commit
4dbf73acb3
@ -297,6 +297,8 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. Capture some front-end samples to hard disk
|
// 3. Capture some front-end samples to hard disk
|
||||||
|
try
|
||||||
|
{
|
||||||
if (front_end_capture(configuration))
|
if (front_end_capture(configuration))
|
||||||
{
|
{
|
||||||
std::cout << "Front-end RAW samples captured" << std::endl;
|
std::cout << "Front-end RAW samples captured" << std::endl;
|
||||||
@ -305,6 +307,15 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
std::cout << "Failure capturing front-end samples" << std::endl;
|
std::cout << "Failure capturing front-end samples" << std::endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(const boost::bad_lexical_cast & e)
|
||||||
|
{
|
||||||
|
std::cout << "Exception catched while capturing samples (bad lexical cast)" << std::endl;
|
||||||
|
}
|
||||||
|
catch(const boost::io::too_few_args & e)
|
||||||
|
{
|
||||||
|
std::cout << "Exception catched while capturing samples (too few args)" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
// 4. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
// 4. Setup GNU Radio flowgraph (file_source -> Acquisition_10m)
|
||||||
gr::top_block_sptr top_block;
|
gr::top_block_sptr top_block;
|
||||||
@ -345,9 +356,9 @@ int main(int argc, char** argv)
|
|||||||
acquisition->connect(top_block);
|
acquisition->connect(top_block);
|
||||||
top_block->connect(source, 0, acquisition->get_left_block(), 0);
|
top_block->connect(source, 0, acquisition->get_left_block(), 0);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(const std::exception & e)
|
||||||
{
|
{
|
||||||
std::cout << "Failure connecting the GNU Radio blocks " << std::endl;
|
std::cout << "Failure connecting the GNU Radio blocks: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Run the flowgraph
|
// 5. Run the flowgraph
|
||||||
@ -400,9 +411,9 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
ch_thread.join();
|
ch_thread.join();
|
||||||
}
|
}
|
||||||
catch(const boost::exception_ptr & e)
|
catch(const boost::thread_resource_error & e)
|
||||||
{
|
{
|
||||||
std::cout << "Exception caught while joining threads " << e << std::endl;
|
LOG(INFO) << "Exception caught while joining threads.";
|
||||||
}
|
}
|
||||||
gnss_sync_vector.clear();
|
gnss_sync_vector.clear();
|
||||||
boost::dynamic_pointer_cast<gr::blocks::file_source>(source)->seek(0, 0);
|
boost::dynamic_pointer_cast<gr::blocks::file_source>(source)->seek(0, 0);
|
||||||
@ -494,7 +505,11 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
catch(const std::logic_error & e)
|
catch(const std::logic_error & e)
|
||||||
{
|
{
|
||||||
std::cout << " " << it->first << " " << it->second << " (Eph not found)" << std::endl;
|
std::cout << "Logic error catched: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
|
catch(const boost::lock_error & e)
|
||||||
|
{
|
||||||
|
std::cout << "Exception catched while reading ephemeris" << std::endl;
|
||||||
}
|
}
|
||||||
catch(int ex)
|
catch(int ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user