diff options
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r-- | c++/src/H5PropList.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index ad9c8ca..8609b60 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -24,7 +24,7 @@ PropList::PropList( H5P_class_t type ) : IdComponent( 0 ) id = H5Pcreate(type ); if( id <= 0 ) { - throw PropListIException(); + throw PropListIException("PropList constructor", "H5Pcreate failed"); } } @@ -46,7 +46,11 @@ void PropList::copy( const PropList& like_plist ) { // reset the identifier of this PropList - send 'this' in so that // H5Pclose can be called appropriately - resetIdComponent( this ); + try { + resetIdComponent( this ); } + catch (Exception close_error) { // thrown by p_close + throw PropListIException("PropList::copy", close_error.getDetailMsg()); + } // call C routine to copy the property list id = H5Pcopy( like_plist.getId() ); @@ -56,7 +60,7 @@ void PropList::copy( const PropList& like_plist ) if( id <= 0 ) { - throw PropListIException(); + throw PropListIException("PropList::copy", "H5Pcopy failed"); } } @@ -68,7 +72,7 @@ void PropList::p_close() const herr_t ret_value = H5Pclose( id ); if( ret_value < 0 ) { - throw PropListIException("PropList::p_close: unable to close the property list. Please report this bug to HDF." ); + throw PropListIException(NULL, "H5Pclose failed" ); } } } @@ -79,7 +83,8 @@ H5P_class_t PropList::getClass() const H5P_class_t plist_class = H5Pget_class( id ); if( plist_class == H5P_NO_CLASS ) { - throw PropListIException(); + throw PropListIException("PropList::getClass", + "H5Pget_class failed - returned H5P_NO_CLASS"); } return( plist_class ); } @@ -89,7 +94,11 @@ H5P_class_t PropList::getClass() const PropList::~PropList() { // The property list id will be closed properly - resetIdComponent( this ); + try { + resetIdComponent( this ); } + catch (Exception close_error) { // thrown by p_close + throw PropListIException("PropList::~PropList", close_error.getDetailMsg()); + } } #ifndef H5_NO_NAMESPACE |