(file) Return to Exception.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Exception.cpp between version 1.23 and 1.33

version 1.23, 2001/12/13 14:53:56 version 1.33, 2002/04/09 03:00:19
Line 24 
Line 24 
 // //
 // Modified By: Nag Boranna (nagaraja_boranna@hp.com) // Modified By: Nag Boranna (nagaraja_boranna@hp.com)
 // //
 // Modified By:  // Modified By: Jenny Yu (jenny_yu@am.exch.hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <cstdio> #include <cstdio>
 #include "Exception.h" #include "Exception.h"
   #include "Tracer.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 54 
Line 55 
     const String& message) : Exception(String())     const String& message) : Exception(String())
 { {
     char lineStr[32];     char lineStr[32];
     sprintf(lineStr, "%d", line);      sprintf(lineStr, "%u", line);
  
     _message = file;     _message = file;
     _message.append("(");     _message.append("(");
     _message.append(lineStr);     _message.append(lineStr);
     _message.append("): ");     _message.append("): ");
     _message.append(message);     _message.append(message);
   
       // ATTN-RK-P3-20020408: Should define a "test" trace component
       PEG_TRACE_STRING(TRC_SERVER, Tracer::LEVEL2, _message);
 } }
  
 const char OutOfBounds::MSG[] = "out of bounds"; const char OutOfBounds::MSG[] = "out of bounds";
Line 101 
Line 105 
     "attempted to resolve a instance that is already resolved";     "attempted to resolve a instance that is already resolved";
  
 const char InstantiatedAbstractClass::MSG[] = const char InstantiatedAbstractClass::MSG[] =
     "attempted to instantiated an abstract class";      "attempted to instantiate an abstract class ";
  
 const char NoSuchProperty::MSG[] = "no such property: "; const char NoSuchProperty::MSG[] = "no such property: ";
  
Line 118 
Line 122 
  
 const char TypeMismatch::MSG[] = "type mismatch"; const char TypeMismatch::MSG[] = "type mismatch";
  
   const char CIMValueIsNull::MSG[] = "null CIMValue accessed";
   
   const char CIMValueInvalidType::MSG[] = "invalid CIMValue type";
   
   const char DynamicCastFailed::MSG[] = "dynamic cast failed";
   
 const char NoSuchFile::MSG[] = "no such file: "; const char NoSuchFile::MSG[] = "no such file: ";
  
 const char FileNotReadable::MSG[] = "file not readable: "; const char FileNotReadable::MSG[] = "file not readable: ";
Line 191 
Line 201 
  
 const char SSL_Exception::MSG[] = "SSL Exception "; const char SSL_Exception::MSG[] = "SSL Exception ";
  
   const char InvalidAuthHeader::MSG[] = "Invalid Authorization header";
   
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // CIMException // CIMException
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
   //
   // Creates a message without source file name and line number.
   //
   static String _makeCIMExceptionMessage(
       CIMStatusCode code,
       const String& description)
   {
       String tmp;
       tmp.append(CIMStatusCodeToString(code));
       tmp.append(": \"");
       tmp.append(description);
       tmp.append("\"");
       return tmp;
   }
   
   //
   // Creates a message with source file name and line number.
   //
 static String _makeCIMExceptionMessage( static String _makeCIMExceptionMessage(
     CIMStatusCode code,     CIMStatusCode code,
       const String& description,
     const char* file,     const char* file,
     Uint32 line,      Uint32 line)
     const String& extraMessage)  
 { {
     String tmp = file;     String tmp = file;
     tmp.append("(");     tmp.append("(");
Line 212 
Line 243 
  
     tmp.append(CIMStatusCodeToString(code));     tmp.append(CIMStatusCodeToString(code));
     tmp.append(": \"");     tmp.append(": \"");
     tmp.append(extraMessage);      tmp.append(description);
     tmp.append("\"");     tmp.append("\"");
     return tmp;     return tmp;
 } }
  
   //
   // Returns a message string specifically for tracing.
   //
   String CIMException::getTraceMessage() const
   {
       String traceMsg =
           _makeCIMExceptionMessage(_code, _description, _file, _line);
   
       return traceMsg;
   }
   
 CIMException::CIMException( CIMException::CIMException(
     CIMStatusCode code,     CIMStatusCode code,
       const String& description,
     const char* file,     const char* file,
     Uint32 line,      Uint32 line)
     const String& extraMessage)      :
     : Exception(_makeCIMExceptionMessage(code, file, line, extraMessage)),  #ifdef DEBUG_CIMEXCEPTION
     _code(code)      Exception(_makeCIMExceptionMessage(code, description, file, line)),
   #else
       Exception(_makeCIMExceptionMessage(code, description)),
   #endif
       _code(code),
       _description(description),
       _file(file),
       _line(line)
 { {
  
 } }
  
   CIMException::CIMException(const CIMException& cimException)
       : Exception(cimException.getMessage()),
       _code(cimException._code),
       _description(cimException._description),
       _file(cimException._file),
       _line(cimException._line)
   {
   }
   
 void ThrowUnitializedHandle() void ThrowUnitializedHandle()
 { {
     throw UnitializedHandle();     throw UnitializedHandle();


Legend:
Removed from v.1.23  
changed lines
  Added in v.1.33

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2