From fe537efa6e65b2d11277b3972a146eee455a9c7b Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sat, 11 Apr 2020 21:21:33 +0200 Subject: [PATCH] improved error messages for NeXus file reading. Especially for the case of HDF4/HDF5 <-> NeXus version issues. --- src/external/nexus/PNeXus.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/external/nexus/PNeXus.cpp b/src/external/nexus/PNeXus.cpp index 43f70853..e6ed725d 100644 --- a/src/external/nexus/PNeXus.cpp +++ b/src/external/nexus/PNeXus.cpp @@ -2045,7 +2045,14 @@ int PNeXus::ReadFile(const char *fileName) // close file NXclose(&fFileHandle); + std::stringstream ss; switch (fIdfVersion) { + case 0: + fErrorCode = PNEXUS_IDF_NOT_IMPLEMENTED; + ss << ">> **ERROR** update of the HDF4/HDF5 libs without recompilation of the NeXus lib?"; + fErrorMsg = ss.str(); + status = NX_ERROR; + break; case 1: status = ReadFileIdf1(); if (status != NX_OK) { @@ -2062,7 +2069,6 @@ int PNeXus::ReadFile(const char *fileName) break; default: fErrorCode = PNEXUS_IDF_NOT_IMPLEMENTED; - std::stringstream ss; ss << ">> **ERROR** idf_version=" << fIdfVersion << " not yet implemented."; fErrorMsg = ss.str(); status = NX_ERROR;