From f1932cb58219fd121ddb88cb9168a0caafad3a4c Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 6 Mar 2001 02:08:33 -0500 Subject: [svn-r3550] Purpose: Bug fix Description: The Exception destructor accidently called H5Eprint, which caused error messages to be printed where they are not supposed to because the failures are expected. Solution: Removed that lousy call! Platforms tested: arabica (sparc-sun-solaris 2.7) --- c++/src/H5Exception.cpp | 12 ++++++------ c++/src/H5Exception.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index c6e0efc..86606db 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -120,21 +120,21 @@ string Exception::getDetailMesg() const return( detailMessage ); } -// Prints the error stack in a default manner. -void Exception::printError( FILE* stream ) const +const char* Exception::getCDetailMesg() const { - herr_t ret_value = H5Eprint( NULL ); // print to stderr - if( ret_value < 0 ) - throw Exception( "Exception::printError" ); + return( detailMessage.c_str() ); } -Exception::~Exception() +// Prints the error stack in a default manner. +void Exception::printError( FILE* stream ) const { herr_t ret_value = H5Eprint( NULL ); // print to stderr if( ret_value < 0 ) throw Exception( "Exception::printError" ); } +Exception::~Exception() {} + FileIException::FileIException():Exception(){} FileIException::FileIException( string message ): Exception( message ){} FileIException::~FileIException() {} diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index e8aeee4..0bc12ee 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -32,7 +32,7 @@ class Exception { // Returns the detailed message set at the time the exception is thrown string getDetailMesg() const; - char* getCDetailMesg(); // C string of detailed message + const char* getCDetailMesg() const; // C string of detailed message // Turns on the automatic error printing. static void setAutoPrint( H5E_auto_t func, void* client_data ); -- cgit v0.12