summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Group.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2001-03-10 03:59:46 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2001-03-10 03:59:46 (GMT)
commit9cd9f7f5216fbc30b10426f5bd11e26d81668eac (patch)
treebe3e4f25e5a870f8e98c7b1cfce3917a5dd19269 /c++/src/H5Group.cpp
parentcd29e12e0252ccfc969281c5dabd991b46203f05 (diff)
downloadhdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.zip
hdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.tar.gz
hdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.tar.bz2
[svn-r3602]
Purpose: Usability enhancement Description: - Added more information about the failure to all the throw's, i.e, member function name and more detail about the failure, where appropriate. Also, added exception throws for private functions, such as p_close to provide more specific details. - Added two api functions: Exception::getFuncName() and Exception::getCFuncName() to provide the name of the member function where failure occurs. - Fixed some typos, one of which caused segn. fault in some situations (resetIdComponent was accidentally called twice in a couple of places :) Platforms: arabica (sparc-sun-solaris 2.7)
Diffstat (limited to 'c++/src/H5Group.cpp')
-rw-r--r--c++/src/H5Group.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index c0ae1d3..52fb816 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -51,7 +51,7 @@ Group::Group( const hid_t group_id ) : H5Object( group_id ) {}
//return( ret_value );
//else // raise exception when H5Aiterate returns a negative value
//{
- //throw GroupIException();
+ //throw GroupIException("Group::iterateElems", "H5Giterate failed");
//}
//}
@@ -61,14 +61,16 @@ void Group::p_close() const
herr_t ret_value = H5Gclose( id );
if( ret_value < 0 )
{
- throw GroupIException();
+ throw GroupIException(NULL, "H5Gclose failed");
}
}
// Throw file exception
-void Group::throwException() const
+void Group::throwException(const string& func_name, const string& msg) const
{
- throw GroupIException();
+ string full_name = func_name;
+ full_name.insert(0, "Group::");
+ throw GroupIException(full_name, msg);
}
// The destructor of this instance calls IdComponent::reset to
@@ -79,7 +81,12 @@ void Group::throwException() const
Group::~Group()
{
// The group id will be closed properly
- resetIdComponent( this );
+ try {
+ resetIdComponent( this ); }
+ catch (Exception close_error) { // thrown by p_close
+ throw GroupIException("Group::~Group", close_error.getDetailMsg());
+ }
+
}
#ifndef H5_NO_NAMESPACE