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/H5AtomType.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/H5AtomType.cpp')
-rw-r--r-- | c++/src/H5AtomType.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index bdd98b0..1ec8096 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -29,7 +29,7 @@ void AtomType::setSize( size_t size ) const herr_t ret_value = H5Tset_size( id, size ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::setSize", "H5Tset_size failed"); } } @@ -42,7 +42,8 @@ H5T_order_t AtomType::getOrder( string& order_string ) const // return a byte order constant if successful if( type_order == H5T_ORDER_ERROR ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::getOrder", + "H5Tget_order returns H5T_ORDER_ERROR"); } if( type_order == H5T_ORDER_LE ) order_string = "Little endian byte ordering (0)"; @@ -60,7 +61,7 @@ void AtomType::setOrder( H5T_order_t order ) const herr_t ret_value = H5Tset_order( id, order ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::setOrder", "H5Tset_order failed"); } } @@ -72,7 +73,8 @@ size_t AtomType::getPrecision() const // returns number of significant bits if successful if( num_signi_bits == 0 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::getPrecision", + "H5Tget_precision returns invalid number of significant bits"); } return( num_signi_bits ); } @@ -84,7 +86,7 @@ void AtomType::setPrecision( size_t precision ) const herr_t ret_value = H5Tset_precision( id, precision ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::setPrecision", "H5Tset_precision failed"); } } @@ -99,7 +101,8 @@ int AtomType::getOffset() const // returns a non-negative offset value if successful if( offset == -1 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::getOffset", + "H5Tget_offset returns a negative offset value"); } return( offset ); } @@ -111,7 +114,7 @@ void AtomType::setOffset( size_t offset ) const herr_t ret_value = H5Tset_offset( id, offset ); if( ret_value < 0 ) { - throw DataTypeIException(); + throw DataTypeIException("AtomType::setOffset", "H5Tset_offset failed"); } } @@ -123,7 +126,7 @@ void AtomType::setOffset( size_t offset ) const //herr_t ret_value = H5Tget_pad( id, &lsb, &msb ); //if( ret_value < 0 ) //{ - //throw DataTypeIException(); + //throw DataTypeIException("AtomType::getPad", "H5Tget_pad failed"); //} //} @@ -134,7 +137,7 @@ void AtomType::setOffset( size_t offset ) const //herr_t ret_value = H5Tset_pad( id, lsb, msb ); //if( ret_value < 0 ) //{ - //throw DataTypeIException(); + //throw DataTypeIException("AtomType::setPad", "H5Tset_pad failed"); //} //} |