From dc2effe6b793d2ac753628cff4a3a7c85b150f44 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 12 Jan 2017 08:45:28 -0600 Subject: [PATCH] Improve error handling when duplicate variable added to a DRHDF5 #353 Added a printout that shows the logging group and variable name that had a problem when trying to add to the HDF5 recording. --- trick_source/sim_services/DataRecord/src/DRHDF5.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trick_source/sim_services/DataRecord/src/DRHDF5.cpp b/trick_source/sim_services/DataRecord/src/DRHDF5.cpp index 8598d9b5..b16383cb 100644 --- a/trick_source/sim_services/DataRecord/src/DRHDF5.cpp +++ b/trick_source/sim_services/DataRecord/src/DRHDF5.cpp @@ -173,6 +173,11 @@ int Trick::DRHDF5::format_specific_init() { */ hdf5_info->dataset = H5PTcreate_fl(root_group, rec_buffer[ii]->ref->reference, datatype, chunk_size, 1) ; + if ( hdf5_info->dataset == H5I_BADID ) { + message_publish(MSG_ERROR, "An error occured in data record group \"%s\" when adding \"%s\".\n", + group_name.c_str() , rec_buffer[ii]->ref->reference) ; + } + hdf5_info->drb = rec_buffer[ii] ; /* Add the new parameter element to the end of the vector. * This effectively increases the vector size by one. */