[cig-commits] r13731 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Dec 17 02:32:23 PST 2008
Author: luis
Date: 2008-12-17 02:32:23 -0800 (Wed, 17 Dec 2008)
New Revision: 13731
Modified:
cs/cigma/trunk/src/io_hdf5.cpp
cs/cigma/trunk/src/io_hdf5.h
Log:
Display detailed message, instead of exception traceback
Modified: cs/cigma/trunk/src/io_hdf5.cpp
===================================================================
--- cs/cigma/trunk/src/io_hdf5.cpp 2008-12-17 10:32:22 UTC (rev 13730)
+++ cs/cigma/trunk/src/io_hdf5.cpp 2008-12-17 10:32:23 UTC (rev 13731)
@@ -90,7 +90,7 @@
{
if (obj) { delete obj; }
if (attr) { delete attr; }
- //error.printError();
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -5;
}
@@ -112,7 +112,7 @@
-//* open hdf5 file
+// open hdf5 file
H5::H5File* h5_open_file(const char *filename, const char *mode)
{
std::string m(mode);
@@ -166,15 +166,14 @@
}
catch (H5::FileIException error)
{
- std::cout << "Error: " << error.getCDetailMsg() << " (in " << error.getCFuncName() << ")" << std::endl;
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
}
return file;
}
-// */
-//* open hdf5 group
+// open hdf5 group
H5::Group* h5_open_group(H5::H5File *file, const char *loc)
{
H5::Group* group = 0;
@@ -189,16 +188,15 @@
}
catch (H5::Exception error)
{
- //std::cout << "Error: " << error.getCDetailMsg() << " (in " << error.getCFuncName() << ")" << std::endl;
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
}
}
return group;
}
-// */
-//* open hdf5 dataset
+// open hdf5 dataset
H5::DataSet* h5_open_dataset(H5::H5File *file, const char *loc)
{
H5::DataSet* dataset = 0;
@@ -213,16 +211,15 @@
}
catch (H5::Exception error)
{
- std::cout << "Error: " << error.getCDetailMsg() << " (in " << error.getCFuncName() << ")" << std::endl;
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
}
}
return dataset;
}
-// */
-//* open object in hdf5 file
+// open object in hdf5 file
H5::H5Object* h5_open_object(H5::H5File *file, const char *loc)
{
H5::H5Object* obj = 0;
@@ -239,10 +236,9 @@
return obj;
}
-// */
-//* open attribute on hdf5 object
+// open attribute on hdf5 object
H5::Attribute* h5_open_attribute(H5::H5Object *obj, const char *attr_name)
{
H5::Attribute *attribute = 0;
@@ -255,13 +251,12 @@
}
catch (H5::Exception error)
{
- //std::cout << "Error: " << error.getCDetailMsg() << " (in " << error.getCFuncName() << ")" << std::endl;
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
}
}
return attribute;
}
-// */
#endif /* HAVE_HDF5 */
Modified: cs/cigma/trunk/src/io_hdf5.h
===================================================================
--- cs/cigma/trunk/src/io_hdf5.h 2008-12-17 10:32:22 UTC (rev 13730)
+++ cs/cigma/trunk/src/io_hdf5.h 2008-12-17 10:32:23 UTC (rev 13731)
@@ -84,7 +84,6 @@
try
{
- //H5::DataSet dataset = file->openDataSet(loc);
H5::DataSet* dataset = h5_open_dataset(file, loc);
if (dataset == 0)
{
@@ -141,17 +140,20 @@
}
catch (H5::DataSetIException error)
{
- error.printError();
+ //error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -5;
}
catch (H5::DataSpaceIException error)
{
- error.printError();
+ //error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -6;
}
catch (H5::Exception error)
{
- error.printError();
+ //error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -7;
}
return 0;
@@ -182,17 +184,20 @@
}
catch (H5::DataSpaceIException error)
{
- error.printError();
+ //error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -1;
}
catch (H5::DataSetIException error)
{
- error.printError();
+ //error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -1;
}
catch (H5::Exception error)
{
//error.printError();
+ std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -1;
}
@@ -237,7 +242,7 @@
{
if (obj) { delete obj; }
if (attr) { delete attr; }
- //error.printError();
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
return -4;
}
@@ -306,8 +311,8 @@
}
catch (H5::Exception error)
{
+ //std::cout << "Error: " << error.getDetailMsg() << " (in " << error.getFuncName() << ")" << std::endl;
std::cerr << "Error: Could not set attribute '" << attr_name << "'" << std::endl;
- error.printError();
return -2;
}
More information about the CIG-COMMITS
mailing list