diff --git a/api/bag_dataset.cpp b/api/bag_dataset.cpp index ab04c9276b..02f332d900 100644 --- a/api/bag_dataset.cpp +++ b/api/bag_dataset.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace BAG { @@ -1055,6 +1056,11 @@ std::tuple Dataset::gridToGeo( return {x, y}; } +void handleAbrt(int signum) { + std::cerr << "\nUnrecoverable HDF5 Error \n"; + exit(signum); +} + //! Read an existing BAG. /*! \param fileName @@ -1066,6 +1072,7 @@ void Dataset::readDataset( const std::string& fileName, OpenMode openMode) { + signal(SIGABRT, handleAbrt); m_pH5file = std::unique_ptr<::H5::H5File, DeleteH5File>(new ::H5::H5File{ fileName.c_str(), (openMode == BAG_OPEN_READONLY) ? H5F_ACC_RDONLY : H5F_ACC_RDWR},