(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.7 and 1.27

version 1.7, 2001/02/16 02:06:06 version 1.27, 2002/03/05 00:49:03
Line 1 
Line 1 
 //BEGIN_LICENSE  //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a  // Permission is hereby granted, free of charge, to any person obtaining a copy
 // copy of this software and associated documentation files (the "Software"),  // of this software and associated documentation files (the "Software"), to
 // to deal in the Software without restriction, including without limitation  // deal in the Software without restriction, including without limitation the
 // the rights to use, copy, modify, merge, publish, distribute, sublicense,  // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 // and/or sell copies of the Software, and to permit persons to whom the  // sell copies of the Software, and to permit persons to whom the Software is
 // Software is furnished to do so, subject to the following conditions:  // furnished to do so, subject to the following conditions:
 // //
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 // DEALINGS IN THE SOFTWARE.  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //END_LICENSE  //==============================================================================
 //BEGIN_HISTORY  
 // //
 // Author:  // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // $Log$  // Modified By: Nag Boranna (nagaraja_boranna@hp.com)
 // Revision 1.7  2001/02/16 02:06:06  mike  
 // Renamed many classes and headers.  
 // //
 // Revision 1.6  2001/02/11 05:42:33  mike  // Modified By:
 // new  
 // //
 // Revision 1.5  2001/01/29 02:23:44  mike  //%/////////////////////////////////////////////////////////////////////////////
 // Added support for GetInstance operation  
 //  
 // Revision 1.4  2001/01/28 04:11:03  mike  
 // fixed qualifier resolution  
 //  
 // Revision 1.3  2001/01/23 01:25:35  mike  
 // Reworked resolve scheme.  
 //  
 // Revision 1.2  2001/01/22 00:45:47  mike  
 // more work on resolve scheme  
 //  
 // Revision 1.1.1.1  2001/01/14 19:51:33  mike  
 // Pegasus import  
 //  
 //  
 //END_HISTORY  
  
 #include <cstdio> #include <cstdio>
 #include "Exception.h" #include "Exception.h"
Line 88 
Line 69 
  
 const char NullPointer::MSG[] = "null pointer"; const char NullPointer::MSG[] = "null pointer";
  
 const char UnitializedHandle::MSG[] = "unitialized reference";  const char UnitializedHandle::MSG[] = "unitialized handle";
  
 const char IllegalName::MSG[] = "illegal CIM name"; const char IllegalName::MSG[] = "illegal CIM name";
  
 const char NoSuchSuperClass::MSG[] = "no such super class: ";  
   
 const char NoSuchClass::MSG[] = "no such class: ";  
   
 const char InvalidPropertyOverride::MSG[] = "invalid property override: "; const char InvalidPropertyOverride::MSG[] = "invalid property override: ";
  
 const char InvalidMethodOverride::MSG[] = "invalid method override: "; const char InvalidMethodOverride::MSG[] = "invalid method override: ";
Line 141 
Line 118 
  
 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 CannotBindToAddress::MSG[] = "cannot bind to address: ";
   
 const char NoSuchDirectory::MSG[] = "no such directory: "; const char NoSuchDirectory::MSG[] = "no such directory: ";
  
 const char ChangeDirectoryFailed::MSG[] = "failed to change directory: ";  const char ChangeDirectoryFailed::MSG[] = "cannot change directory: ";
  
 const char CannotCreateDirectory::MSG[] = "cannot create directory: "; const char CannotCreateDirectory::MSG[] = "cannot create directory: ";
  
Line 155 
Line 142 
  
 const char NotImplemented::MSG[] = "not implemented: "; const char NotImplemented::MSG[] = "not implemented: ";
  
 const char FailedToRemoveDirectory::MSG[] = "failed to remove directory: ";  const char CannotRemoveDirectory::MSG[] = "cannot remove directory: ";
   
   const char CannotRemoveFile::MSG[] = "cannot remove file: ";
   
   const char CannotRenameFile::MSG[] = "cannot rename file: ";
   
   const char StackUnderflow::MSG[] = "stack underflow";
  
 const char FailedToRemoveFile::MSG[] = "failed to remove file: ";  const char StackOverflow::MSG[] = "stack overflow";
  
 const char StackUnderflow::MSG[] = "stack overflow";  const char QueueUnderflow::MSG[] = "queue Underflow";
  
 const char BadFormat::MSG[] = "bad format passed to Formatter::format()"; const char BadFormat::MSG[] = "bad format passed to Formatter::format()";
  
Line 169 
Line 162 
  
 const char BadlyFormedCGIQueryString::MSG[] = "badly formed CGI query string"; const char BadlyFormedCGIQueryString::MSG[] = "badly formed CGI query string";
  
 const char BadInstanceName::MSG[] = "bad instance name: ";  const char IllformedObjectName::MSG[] = "illformed object name: ";
  
 const char DynamicLoadFailed::MSG[] = "load of dynamic library failed: "; const char DynamicLoadFailed::MSG[] = "load of dynamic library failed: ";
  
Line 178 
Line 171 
  
 const char CannotOpenDirectory::MSG[] = "cannot open directory: "; const char CannotOpenDirectory::MSG[] = "cannot open directory: ";
  
 ////////////////////////////////////////////////////////////////////////////////  const char CorruptFile::MSG[] = "corrupt file: ";
 //  
 // CimException  
 //  
 ////////////////////////////////////////////////////////////////////////////////  
  
 static char* _cimMessages[] =  const char BindFailed::MSG[] = "Bind failed: ";
 {  
     "successful",  
   
     "A general error occurred that is not covered by a more specific "  
     "error code.",  
  
     "Access to a CIM resource was not available to the client.",  const char InvalidLocator::MSG[] = "Invalid locator: ";
  
     "The target namespace does not exist.",  const char CannotCreateSocket::MSG[] = "Cannot create socket";
  
     "One or more parameter values passed to the method were invalid.",  const char CannotConnect::MSG[] = "Cannot connect to: ";
  
     "The specified class does not exist.",  const char UnexpectedFailure::MSG[] = "Unexpected failure";
  
     "The requested object could not be found.",  const char FailedToConnect::MSG[] = "failed to connect";
  
     "The requested operation is not supported.",  const char AlreadyConnected::MSG[] = "already connected";
  
     "Operation cannot be carried out on this class since it has subclasses.",  const char NotConnected::MSG[] = "not connected";
  
     "Operation cannot be carried out on this class since it has instances.",  const char TimedOut::MSG[] = "timed out";
  
     "Operation cannot be carried out since the specified "  const char ParseError::MSG[] = "parse error: ";
     "superClass does not exist.",  
  
     "Operation cannot be carried out because an object already exists.",  const char MissingNullTerminator::MSG[] = "missing null terminator: ";
  
     "The specified property does not exist.",  const char SSL_Exception::MSG[] = "SSL Exception ";
  
     "The value supplied is incompatible with the type.",  const char InvalidAuthHeader::MSG[] = "Invalid Authorization header";
  
     "The query language is not recognized or supported.",  
  
     "The query is not valid for the specified query language.",  ////////////////////////////////////////////////////////////////////////////////
   //
     "The extrinsic method could not be executed.",  // CIMException
   //
   ////////////////////////////////////////////////////////////////////////////////
  
     "The specified extrinsic method does not exist."  static String _makeCIMExceptionMessage(
 };      CIMStatusCode code,
       const char* file,
       Uint32 line,
       const String& extraMessage)
   {
       String tmp = file;
       tmp.append("(");
       char buffer[32];
       sprintf(buffer, "%d", line);
       tmp.append(buffer);
       tmp.append("): ");
   
       tmp.append(CIMStatusCodeToString(code));
       tmp.append(": \"");
       tmp.append(extraMessage);
       tmp.append("\"");
       return tmp;
   }
  
 CimException::CimException(CimException::Code code)  CIMException::CIMException(
     : Exception(_cimMessages[Uint32(code)]), _code(code)      CIMStatusCode code,
       const char* file,
       Uint32 line,
       const String& extraMessage)
       : Exception(_makeCIMExceptionMessage(code, file, line, extraMessage)),
       _code(code)
 { {
  
 } }
  
 const char* CimException::codeToString(CimException::Code code)  void ThrowUnitializedHandle()
 { {
     return _cimMessages[Uint32(code)];      throw UnitializedHandle();
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.7  
changed lines
  Added in v.1.27

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2