version 1.15, 2001/06/03 17:05:03
|
version 1.23, 2001/12/13 14:53:56
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// 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. |
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
|
// Modified By: Nag Boranna (nagaraja_boranna@hp.com) |
|
// |
// Modified By: | // Modified By: |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
|
|
| |
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 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 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 CannotRemoveFile::MSG[] = "cannot remove file: "; |
| |
const char FailedToRemoveFile::MSG[] = "failed to remove file: "; |
const char CannotRenameFile::MSG[] = "cannot rename file: "; |
| |
const char StackUnderflow::MSG[] = "stack overflow"; |
const char StackUnderflow::MSG[] = "stack underflow"; |
|
|
|
const char StackOverflow::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()"; |
| |
|
|
| |
const char CannotOpenDirectory::MSG[] = "cannot open directory: "; | const char CannotOpenDirectory::MSG[] = "cannot open directory: "; |
| |
//////////////////////////////////////////////////////////////////////////////// |
const char CorruptFile::MSG[] = "corrupt file: "; |
// |
|
// CIMException |
|
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
|
|
static const char* _cimMessages[] = |
|
{ |
|
"SUCCESS: successful", |
|
|
|
"FAILED: A general error occurred that is not covered by a more specific " |
|
"error code", |
|
|
|
"ACCESS_DENIED: Access to a CIM resource was not available to the client", |
|
|
|
"INVALID_NAMESPACE: The target namespace does not exist", |
|
| |
"INVALID_PARAMETER: One or more parameter values passed to the method " |
const char BindFailed::MSG[] = "Bind failed: "; |
"were invalid", |
|
| |
"INVALID_CLASS: The specified class does not exist", |
const char InvalidLocator::MSG[] = "Invalid locator: "; |
| |
"NOT_FOUND: The requested object could not be found", |
const char CannotCreateSocket::MSG[] = "Cannot create socket"; |
| |
"NOT_SUPPORTED: The requested operation is not supported", |
const char CannotConnect::MSG[] = "Cannot connect to: "; |
| |
"CLASS_HAS_CHILDREN: Operation cannot be carried out on this class since " |
const char UnexpectedFailure::MSG[] = "Unexpected failure"; |
"it has subclasses", |
|
| |
"CLASS_HAS_INSTANCES: Operation cannot be carried out on this class since " |
const char FailedToConnect::MSG[] = "failed to connect"; |
"it has instances", |
|
| |
"INVALID_SUPERCLASS: Operation cannot be carried out since the specified " |
const char AlreadyConnected::MSG[] = "already connected"; |
"superclass does not exist", |
|
| |
"ALREADY_EXISTS: Operation cannot be carried out because an object already " |
const char NotConnected::MSG[] = "not connected"; |
"exists", |
|
| |
"NO_SUCH_PROPERTY: The specified property does not exist", |
const char TimedOut::MSG[] = "timed out"; |
| |
"TYPE_MISMATCH: The value supplied is incompatible with the type", |
const char ParseError::MSG[] = "parse error: "; |
| |
"QUERY_LANGUAGE_NOT_SUPPORTED: The query language is not recognized or " |
const char MissingNullTerminator::MSG[] = "missing null terminator: "; |
"supported", |
|
| |
"INVALID_QUERY: The query is not valid for the specified query language", |
const char SSL_Exception::MSG[] = "SSL Exception "; |
| |
"METHOD_NOT_AVAILABLE: The extrinsic method could not be executed", |
//////////////////////////////////////////////////////////////////////////////// |
|
// |
"METHOD_NOT_FOUND: The specified extrinsic method does not exist" |
// CIMException |
}; |
// |
|
//////////////////////////////////////////////////////////////////////////////// |
| |
static String _makeCIMExceptionMessage( | static String _makeCIMExceptionMessage( |
CIMException::Code code, |
CIMStatusCode code, |
const char* file, | const char* file, |
Uint32 line, | Uint32 line, |
const String& extraMessage) | const String& extraMessage) |
|
|
tmp.append(buffer); | tmp.append(buffer); |
tmp.append("): "); | tmp.append("): "); |
| |
tmp.append(_cimMessages[Uint32(code)]); |
tmp.append(CIMStatusCodeToString(code)); |
tmp.append(": \""); | tmp.append(": \""); |
tmp.append(extraMessage); | tmp.append(extraMessage); |
tmp.append("\""); | tmp.append("\""); |
|
|
} | } |
| |
CIMException::CIMException( | CIMException::CIMException( |
CIMException::Code code, |
CIMStatusCode code, |
const char* file, | const char* file, |
Uint32 line, | Uint32 line, |
const String& extraMessage) | const String& extraMessage) |
|
|
| |
} | } |
| |
const char* CIMException::codeToString(CIMException::Code code) |
|
{ |
|
return _cimMessages[Uint32(code)]; |
|
} |
|
|
|
void ThrowUnitializedHandle() | void ThrowUnitializedHandle() |
{ | { |
throw UnitializedHandle(); | throw UnitializedHandle(); |