diff --git a/lib/serialisation/Hdf5IO.h b/lib/serialisation/Hdf5IO.h index 0fb277b0..3edb7d10 100644 --- a/lib/serialisation/Hdf5IO.h +++ b/lib/serialisation/Hdf5IO.h @@ -177,23 +177,18 @@ namespace Grid // read the dimensions H5NS::DataSpace dataSpace; - H5E_auto2_t func; - void * client_data; std::vector hdim; std::vector dim; hsize_t size = 1; - H5NS::Exception::getAutoPrint(func, &client_data); - try + if (group_.attrExists(s)) { - H5NS::Exception::dontPrint(); - dataSpace = group_.openDataSet(s).getSpace(); - } - catch (H5NS::Exception &e) - { - H5NS::Exception::setAutoPrint(func, client_data); dataSpace = group_.openAttribute(s).getSpace(); } + else + { + dataSpace = group_.openDataSet(s).getSpace(); + } hdim.resize(dataSpace.getSimpleExtentNdims()); dataSpace.getSimpleExtentDims(hdim.data()); for (auto &d: hdim)