summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DcreatProp.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/H5DcreatProp.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/H5DcreatProp.cpp')
-rw-r--r--c++/src/H5DcreatProp.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp
index 39b653e..4f3d2e4 100644
--- a/c++/src/H5DcreatProp.cpp
+++ b/c++/src/H5DcreatProp.cpp
@@ -24,7 +24,7 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
herr_t ret_value = H5Pset_chunk( id, ndims, dim );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed");
}
}
@@ -35,7 +35,8 @@ H5D_layout_t DSetCreatPropList::getLayout() const
H5D_layout_t layout = H5Pget_layout( id );
if( layout == H5D_LAYOUT_ERROR )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getLayout",
+ "H5Pget_layout returns H5D_LAYOUT_ERROR");
}
return( layout );
}
@@ -46,7 +47,8 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
int chunk_size = H5Pget_chunk( id, max_ndims, dim );
if( chunk_size < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getChunk",
+ "H5Pget_chunk returns negative chunk size");
}
return( chunk_size );
}
@@ -57,7 +59,8 @@ void DSetCreatPropList::setLayout(hid_t plist, H5D_layout_t layout ) const
herr_t ret_value = H5Pset_layout( id, layout );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setLayout",
+ "H5Pset_layout failed");
}
}
@@ -67,7 +70,8 @@ void DSetCreatPropList::setDeflate( int level ) const
herr_t ret_value = H5Pset_deflate( id, level );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setDeflate",
+ "H5Pset_deflate failed");
}
}
@@ -77,7 +81,8 @@ void DSetCreatPropList::setFillValue( DataType& fvalue_type, const void* value )
herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setFillValue",
+ "H5Pset_fill_value failed");
}
}
@@ -87,7 +92,8 @@ void DSetCreatPropList::getFillValue( DataType& fvalue_type, void* value ) const
herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getFillValue",
+ "H5Pget_fill_value failed");
}
}
@@ -97,7 +103,8 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter, unsigned int flags, size
herr_t ret_value = H5Pset_filter( id, filter, flags, cd_nelmts, cd_values );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setFilter",
+ "H5Pset_filter failed");
}
}
@@ -107,7 +114,8 @@ int DSetCreatPropList::getNfilters() const
int num_filters = H5Pget_nfilters( id );
if( num_filters < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getNfilters",
+ "H5Pget_nfilters returned negative number of filters");
}
else
return( num_filters );
@@ -117,10 +125,12 @@ int DSetCreatPropList::getNfilters() const
H5Z_filter_t DSetCreatPropList::getFilter( int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[] ) const
{
H5Z_filter_t filter;
- filter = H5Pget_filter( id, filter_number, &flags, &cd_nelmts, cd_values, namelen, name );
+ filter = H5Pget_filter( id, filter_number, &flags, &cd_nelmts,
+ cd_values, namelen, name );
if( filter == H5Z_FILTER_ERROR )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getFilter",
+ "H5Pget_filter returned H5Z_FILTER_ERROR");
}
else
return( filter );
@@ -132,7 +142,8 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz
herr_t ret_value = H5Pset_external( id, name, offset, size );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::setExternal",
+ "H5Pset_external failed");
}
}
@@ -142,7 +153,8 @@ int DSetCreatPropList::getExternalCount() const
int num_ext_files = H5Pget_external_count( id );
if( num_ext_files < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getExternalCount",
+ "H5Pget_external_count returns negative number of external files");
}
else
return( num_ext_files );
@@ -154,7 +166,8 @@ void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_
herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size );
if( ret_value < 0 )
{
- throw PropListIException();
+ throw PropListIException("DSetCreatPropList::getExternal",
+ "H5Pget_external failed");
}
}