diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-10 03:59:46 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-10 03:59:46 (GMT) |
commit | 9cd9f7f5216fbc30b10426f5bd11e26d81668eac (patch) | |
tree | be3e4f25e5a870f8e98c7b1cfce3917a5dd19269 /c++/src/H5EnumType.cpp | |
parent | cd29e12e0252ccfc969281c5dabd991b46203f05 (diff) | |
download | hdf5-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/H5EnumType.cpp')
-rw-r--r-- | c++/src/H5EnumType.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 303bac5..5bf9ece 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -41,7 +41,7 @@ EnumType::EnumType( const DataSet& dataset ) : DataType() // If the datatype id is not valid, throw an exception if( id <= 0 ) { - throw DataSetIException("Getting datatype fails..."); + throw DataSetIException("EnumType constructor", "H5Dget_type failed"); } } @@ -54,7 +54,7 @@ EnumType::EnumType( const IntType& data_type ) : DataType() // If the datatype id is not valid, throw an exception if( id <= 0 ) { - throw DataSetIException("Creating enumeration datatype fails..."); + throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); } } @@ -69,7 +69,7 @@ void EnumType::insert( const char* name, void *value ) const herr_t ret_value = H5Tenum_insert( id, name, value ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); } } @@ -84,7 +84,7 @@ string EnumType::nameOf( void *value, size_t size ) const // If H5Tenum_nameof returns a negative value, raise an exception, if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); } // otherwise, create the string to hold the datatype name and return it string name = string( name_C ); @@ -104,7 +104,7 @@ void EnumType::valueOf( const char* name, void *value ) const herr_t ret_value = H5Tenum_valueof( id, name, value ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); } } @@ -116,7 +116,7 @@ void EnumType::getMemberValue( int memb_no, void *value ) const hid_t ret_value = H5Tget_member_value( id, memb_no, value ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); } } |