summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Object.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/H5Object.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/H5Object.cpp')
-rw-r--r--c++/src/H5Object.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index a692d0d..6ea4459 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -57,7 +57,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type
}
else
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::createAttribute", "H5Acreate failed");
}
}
@@ -78,7 +78,7 @@ Attribute H5Object::openAttribute( const char* name ) const
}
else
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::openAttribute", "H5Aopen_name failed");
}
}
@@ -99,7 +99,7 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const
}
else
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::openAttribute", "H5Aopen_idx failed");
}
}
@@ -122,7 +122,7 @@ int H5Object::iterateAttrs( attr_operator_t user_op, unsigned * idx, void *op_da
return( ret_value );
else // raise exception when H5Aiterate returns a negative value
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::iterateAttrs", "H5Aiterate failed");
}
}
@@ -132,7 +132,8 @@ int H5Object::getNumAttrs() const
int num_attrs = H5Aget_num_attrs( id );
if( num_attrs < 0 )
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::getNumAttrs",
+ "H5Aget_num_attrs failed - returned negative number of attributes");
}
else
return( num_attrs );
@@ -144,7 +145,7 @@ void H5Object::removeAttr( const char* name ) const
herr_t ret_value = H5Adelete( id, name );
if( ret_value < 0 )
{
- throw AttributeIException();
+ throw AttributeIException("H5Object::removeAttr", "H5Adelete failed");
}
}
void H5Object::removeAttr( const string& name ) const
@@ -158,7 +159,7 @@ void H5Object::flush(H5F_scope_t scope ) const
herr_t ret_value = H5Fflush( id, scope );
if( ret_value < 0 )
{
- throw FileIException();
+ throw FileIException("H5Object::flush", "H5Fflush failed");
}
}