From 0f0fb85517b17d91e83886cac5d2003c76f1263a Mon Sep 17 00:00:00 2001 From: Elisabetta Ronchieri Date: Tue, 20 Sep 2005 10:20:52 +0000 Subject: [PATCH] Started merged with 1.4 --- org.glite.wms-utils.exception/configure.ac | 5 ++++- org.glite.wms-utils.exception/src/Exception.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/org.glite.wms-utils.exception/configure.ac b/org.glite.wms-utils.exception/configure.ac index 30f379f..ae8458a 100755 --- a/org.glite.wms-utils.exception/configure.ac +++ b/org.glite.wms-utils.exception/configure.ac @@ -19,6 +19,9 @@ # # Revision history: # $Log$ +# Revision 1.10 2004/12/10 07:31:35 eronchie +# Increased version +# # Revision 1.9 2004/11/16 15:31:13 eronchie # Increased version # @@ -52,7 +55,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([GLite WMS Utils Exception], [1.0.0]) +AC_INIT([GLite WMS Utils Exception], [1.0.2]) AC_CONFIG_AUX_DIR([./project]) AM_INIT_AUTOMAKE([1.6.3 subdir-objects]) AC_CONFIG_SRCDIR([src/Exception.cpp]) diff --git a/org.glite.wms-utils.exception/src/Exception.cpp b/org.glite.wms-utils.exception/src/Exception.cpp index 38c086d..546f253 100644 --- a/org.glite.wms-utils.exception/src/Exception.cpp +++ b/org.glite.wms-utils.exception/src/Exception.cpp @@ -17,6 +17,7 @@ pthread_mutex_t METHOD_MUTEX ; // This mutex is used in order to lock the file * Exception Class Implementation ************************************/ //Constructor/Destructor + Exception::Exception () { line = 0; }; @@ -33,6 +34,7 @@ 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) @@ -58,7 +60,8 @@ 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(){ @@ -96,14 +99,17 @@ vector Exception::getStackTrace(){ string Exception::dbgMessage(){ string result ; - result = ""; - // Exception name should be displayed only once - if (stack_strings.size()==0){result +=exception_name;}; + //Adding exception Name + 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] ; -- 1.8.2.3