diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-05-10 22:34:16 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-05-10 22:34:16 (GMT) |
commit | 731737845c15958cbe1ceb9141cbaf9e4acf4813 (patch) | |
tree | 8c64f2e7a9340125b14b751c0231d55c88135785 /c++/src/H5DataSet.cpp | |
parent | c470e6bcd60ee20afd19f16ba20e63b8b9a225f6 (diff) | |
parent | 5e4bc6df758b1dffad3583391e51e3c71bb91501 (diff) | |
download | hdf5-731737845c15958cbe1ceb9141cbaf9e4acf4813.zip hdf5-731737845c15958cbe1ceb9141cbaf9e4acf4813.tar.gz hdf5-731737845c15958cbe1ceb9141cbaf9e4acf4813.tar.bz2 |
Merge pull request #1051 in HDFFV/hdf5 from ~BMRIBLER/hdf5_1_8_bmr:hdf5_1_8 to hdf5_1_8
Improvement regarding to Exception hierarchy and throwException.
* commit '5e4bc6df758b1dffad3583391e51e3c71bb91501':
C++ API improvement Description: - Reorganized some exception classes to reflect the HDF5 object hierarchy and provide extendibility. DataSetIException -> LocationException -> Exception DataTypeIException -> LocationException -> Exception GroupIException -> LocationException -> Exception AttributeIException -> LocationException -> Exception FileIException -> GroupIException -> LocationException -> Exception - Added throwException() to these subclasses and use it in H5Location and H5Object member functions to throw an exception that is specific to the object that invokes the member function. Applications that catch the base exception can continue to do the same. - Many cleanup for inconsistencies in comments/headers. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5DataSet.cpp')
-rw-r--r-- | c++/src/H5DataSet.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 14dd607..1dce28e 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -826,6 +826,19 @@ void DataSet::close() } //-------------------------------------------------------------------------- +// Function: DataSet::throwException +///\brief Throws H5::DataSetIException. +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::DataSetIException +// May 2018 +//-------------------------------------------------------------------------- +void DataSet::throwException(const H5std_string& func_name, const H5std_string& msg) const +{ + throw DataSetIException(inMemFunc(func_name.c_str()), msg); +} + +//-------------------------------------------------------------------------- // Function: DataSet destructor ///\brief Properly terminates access to this dataset. // Programmer Binh-Minh Ribler - 2000 |