Started merged with 1.4
authorElisabetta Ronchieri <elisabetta.ronchieri@cnaf.infn.it>
Tue, 20 Sep 2005 10:20:52 +0000 (10:20 +0000)
committerElisabetta Ronchieri <elisabetta.ronchieri@cnaf.infn.it>
Tue, 20 Sep 2005 10:20:52 +0000 (10:20 +0000)
org.glite.wms-utils.exception/configure.ac
org.glite.wms-utils.exception/src/Exception.cpp

index 30f379f..ae8458a 100755 (executable)
@@ -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])
index 38c086d..546f253 100644 (file)
@@ -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<string> 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] ;