summaryrefslogtreecommitdiffstats
path: root/c++/examples/compound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/examples/compound.cpp')
-rw-r--r--c++/examples/compound.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp
index 68de654..d3163d6 100644
--- a/c++/examples/compound.cpp
+++ b/c++/examples/compound.cpp
@@ -70,6 +70,12 @@ int main(void)
}
/*
+ * Turn off the auto-printing when failure occurs so that we can
+ * handle the errors appropriately
+ */
+ Exception::dontPrint();
+
+ /*
* Create the data space.
*/
hsize_t dim[] = {LENGTH}; /* Dataspace dimensions */
@@ -181,24 +187,28 @@ int main(void)
catch( FileIException error )
{
error.printError();
+ return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
error.printError();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
error.printError();
+ return -1;
}
// catch failure caused by the DataSpace operations
catch( DataTypeIException error )
{
error.printError();
+ return -1;
}
return 0;