From: Alessandro Maraschini Date: Wed, 16 Feb 2005 14:15:47 +0000 (+0000) Subject: empty exception name bug fixed X-Git-Tag: gridsite-core_R_1_1_6~47 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=0de64900d0f32d588323ed67008a6f4351f758b7;p=jra1mw.git empty exception name bug fixed --- diff --git a/org.glite.wms-utils.exception/src/Exception.cpp b/org.glite.wms-utils.exception/src/Exception.cpp index 810758b..38c086d 100644 --- a/org.glite.wms-utils.exception/src/Exception.cpp +++ b/org.glite.wms-utils.exception/src/Exception.cpp @@ -12,14 +12,14 @@ namespace wmsutils{ namespace exception { using namespace std ; pthread_mutex_t METHOD_MUTEX ; // This mutex is used in order to lock the file for writing log infornation + /* ********************************* * Exception Class Implementation ************************************/ //Constructor/Destructor - Exception::Exception () { line = 0; -} ; +}; Exception::~Exception() throw(){ } @@ -33,7 +33,6 @@ void Exception::push_back (const string& source, int line_number, const string& line = line_number; method_name = method; error_message = ""; - exception_name = ""; } Exception::Exception( const std::string& file, int line_number, const std::string& method, int code, const std::string& name) @@ -59,8 +58,7 @@ int Exception::getCode(){ const char* Exception::what() const throw(){ if (!ancestor.empty()) return ancestor.c_str(); - - return error_message.c_str(); + return error_message.c_str(); }; string Exception::getExceptionName(){ @@ -98,17 +96,14 @@ vector Exception::getStackTrace(){ string Exception::dbgMessage(){ string result ; - //Adding exception Name - result = exception_name; - + result = ""; + // Exception name should be displayed only once + if (stack_strings.size()==0){result +=exception_name;}; //Adding error msg if (error_message!="") result +=": " + string(what()); - if (result != "") result+="\n"; - //Adding Source result +="\tat " + method_name +"[" +source_file; - //Adding line number if (line!=0){ char buffer [1024] ;