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/H5CommonFG.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/H5CommonFG.cpp')
-rw-r--r-- | c++/src/H5CommonFG.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 000729b..ae6a2bd 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -55,8 +55,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const } else { - //throw File_GroupException(); - throwException(); + throwException("createGroup", "H5Gcreate failed"); } } @@ -79,7 +78,7 @@ Group CommonFG::openGroup( const char* name ) const } else { - throwException(); + throwException("openGroup", "H5Gopen failed"); } } @@ -106,7 +105,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co } else { - throwException(); + throwException("createDataSet", "H5Dcreate failed"); } } @@ -129,7 +128,7 @@ DataSet CommonFG::openDataSet( const char* name ) const } else { - throwException(); + throwException("openDataSet", "H5Dopen failed"); } } @@ -144,7 +143,7 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne herr_t ret_value = H5Glink( getLocId(), link_type, curr_name, new_name ); if( ret_value < 0 ) { - throwException(); + throwException("link", "H5Glink failed"); } } @@ -158,7 +157,7 @@ void CommonFG::unlink( const char* name ) const herr_t ret_value = H5Gunlink( getLocId(), name ); if( ret_value < 0 ) { - throwException(); + throwException("unlink", "H5Gunlink failed"); } } @@ -172,7 +171,7 @@ void CommonFG::move( const char* src, const char* dst ) const herr_t ret_value = H5Gmove( getLocId(), src, dst ); if( ret_value < 0 ) { - throwException(); + throwException("move", "H5Gmove failed"); } } @@ -186,7 +185,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf ); if( ret_value < 0 ) { - throwException(); + throwException("getObjinfo", "H5Gget_objinfo failed"); } } @@ -202,7 +201,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const herr_t ret_value = H5Gget_linkval( getLocId(), name, size, value_C ); if( ret_value < 0 ) { - throwException(); + throwException("getLinkval", "H5Gget_linkval failed"); } string value = string( value_C ); delete value_C; @@ -219,7 +218,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const herr_t ret_value = H5Gset_comment( getLocId(), name, comment ); if( ret_value < 0 ) { - throwException(); + throwException("setComment", "H5Gset_comment failed"); } } @@ -238,7 +237,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const // if H5Gget_comment returns SUCCEED, return the string comment if( ret_value < 0 ) { - throwException(); + throwException("getComment", "H5Gget_comment failed"); } string comment = string( comment_C ); delete comment_C; @@ -262,7 +261,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const // Raise exception if H5Fmount returns negative value if( ret_value < 0 ) { - throwException(); + throwException("mount", "H5Fmount failed"); } } @@ -279,7 +278,7 @@ void CommonFG::unmount( const char* name ) const // Raise exception if H5Funmount returns negative value if( ret_value < 0 ) { - throwException(); + throwException("unmount", "H5Funmount failed"); } } @@ -289,7 +288,7 @@ void CommonFG::unmount( const char* name ) const hid_t CommonFG::p_openDataType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // giving the group id + // giving either the file or group id hid_t datatype_id = H5Topen( getLocId(), name ); // If the datatype id is valid, return it, otherwise, throw an exception. @@ -297,7 +296,7 @@ hid_t CommonFG::p_openDataType( const char* name ) const return( datatype_id ); else { - throwException(); + throwException("openDataType", "H5Topen failed"); } } @@ -382,9 +381,9 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* int ret_value = H5Giterate( getLocId(), name, idx, op, op_data ); if( ret_value >= 0 ) return( ret_value ); - else // raise exception when H5Aiterate returns a negative value + else // raise exception when H5Giterate returns a negative value { - throwException(); + throwException("iterateElems", "H5Giterate failed"); } } |