version 1.7, 2001/02/16 02:06:06
|
version 1.17, 2001/06/12 08:27:43
|
|
|
//BEGIN_LICENSE |
//%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM | // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// | // |
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// DEALINGS IN THE SOFTWARE. | // DEALINGS IN THE SOFTWARE. |
// | // |
//END_LICENSE |
//============================================================================== |
//BEGIN_HISTORY |
|
// | // |
// Author: |
// Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// $Log$ |
// Modified By: |
// 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 |
//%///////////////////////////////////////////////////////////////////////////// |
// 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" |
|
|
| |
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: "; |
|
|
| |
const char NoSuchFile::MSG[] = "no such file: "; | const char NoSuchFile::MSG[] = "no such file: "; |
| |
|
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: "; |
| |
|
|
| |
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 FailedToRemoveFile::MSG[] = "failed to remove file: "; |
const char CannotRemoveFile::MSG[] = "cannot remove file: "; |
|
|
|
const char CannotRenameFile::MSG[] = "cannot rename file: "; |
| |
const char StackUnderflow::MSG[] = "stack overflow"; | const char StackUnderflow::MSG[] = "stack overflow"; |
| |
|
|
| |
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: "; |
| |
|
|
| |
const char CannotOpenDirectory::MSG[] = "cannot open directory: "; | const char CannotOpenDirectory::MSG[] = "cannot open directory: "; |
| |
|
const char CorruptFile::MSG[] = "corrupt file: "; |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// CimException |
// CIMException |
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
static char* _cimMessages[] = |
static const char* _cimMessages[] = |
{ | { |
"successful", |
"SUCCESS: successful", |
| |
"A general error occurred that is not covered by a more specific " |
"FAILED: A general error occurred that is not covered by a more specific " |
"error code.", |
"error code", |
| |
"Access to a CIM resource was not available to the client.", |
"ACCESS_DENIED: Access to a CIM resource was not available to the client", |
| |
"The target namespace does not exist.", |
"INVALID_NAMESPACE: The target namespace does not exist", |
| |
"One or more parameter values passed to the method were invalid.", |
"INVALID_PARAMETER: One or more parameter values passed to the method " |
|
"were invalid", |
| |
"The specified class does not exist.", |
"INVALID_CLASS: The specified class does not exist", |
| |
"The requested object could not be found.", |
"NOT_FOUND: The requested object could not be found", |
| |
"The requested operation is not supported.", |
"NOT_SUPPORTED: The requested operation is not supported", |
| |
"Operation cannot be carried out on this class since it has subclasses.", |
"CLASS_HAS_CHILDREN: Operation cannot be carried out on this class since " |
|
"it has subclasses", |
| |
"Operation cannot be carried out on this class since it has instances.", |
"CLASS_HAS_INSTANCES: Operation cannot be carried out on this class since " |
|
"it has instances", |
| |
"Operation cannot be carried out since the specified " |
"INVALID_SUPERCLASS: Operation cannot be carried out since the specified " |
"superClass does not exist.", |
"superclass does not exist", |
| |
"Operation cannot be carried out because an object already exists.", |
"ALREADY_EXISTS: Operation cannot be carried out because an object already " |
|
"exists", |
| |
"The specified property does not exist.", |
"NO_SUCH_PROPERTY: The specified property does not exist", |
| |
"The value supplied is incompatible with the type.", |
"TYPE_MISMATCH: The value supplied is incompatible with the type", |
| |
"The query language is not recognized or supported.", |
"QUERY_LANGUAGE_NOT_SUPPORTED: The query language is not recognized or " |
|
"supported", |
| |
"The query is not valid for the specified query language.", |
"INVALID_QUERY: The query is not valid for the specified query language", |
| |
"The extrinsic method could not be executed.", |
"METHOD_NOT_AVAILABLE: The extrinsic method could not be executed", |
| |
"The specified extrinsic method does not exist." |
"METHOD_NOT_FOUND: The specified extrinsic method does not exist" |
}; | }; |
| |
CimException::CimException(CimException::Code code) |
static String _makeCIMExceptionMessage( |
: Exception(_cimMessages[Uint32(code)]), _code(code) |
CIMException::Code 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(_cimMessages[Uint32(code)]); |
|
tmp.append(": \""); |
|
tmp.append(extraMessage); |
|
tmp.append("\""); |
|
return tmp; |
|
} |
|
|
|
CIMException::CIMException( |
|
CIMException::Code code, |
|
const char* file, |
|
Uint32 line, |
|
const String& extraMessage) |
|
: Exception(_makeCIMExceptionMessage(code, file, line, extraMessage)), |
|
_code(code) |
{ | { |
| |
} | } |
| |
const char* CimException::codeToString(CimException::Code code) |
const char* CIMException::codeToString(CIMException::Code code) |
{ | { |
return _cimMessages[Uint32(code)]; | return _cimMessages[Uint32(code)]; |
} | } |
| |
|
void ThrowUnitializedHandle() |
|
{ |
|
throw UnitializedHandle(); |
|
} |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |