version 1.26, 2007/08/03 18:57:43
|
version 1.39.2.1, 2013/06/03 22:35:12
|
|
|
//%2006//////////////////////////////////////////////////////////////////////// |
//%LICENSE//////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Licensed to The Open Group (TOG) under one or more contributor license |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
// this work for additional information regarding copyright ownership. |
// IBM Corp.; EMC Corporation, The Open Group. |
// Each contributor licenses this file to you under the OpenPegasus Open |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// Source License; you may not use this file except in compliance with the |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// License. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// |
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Permission is hereby granted, free of charge, to any person obtaining a |
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// copy of this software and associated documentation files (the "Software"), |
// EMC Corporation; Symantec Corporation; The Open Group. |
// to deal in the Software without restriction, including without limitation |
// |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// and/or sell copies of the Software, and to permit persons to whom the |
// of this software and associated documentation files (the "Software"), to |
// Software is furnished to do so, subject to the following conditions: |
// deal in the Software without restriction, including without limitation the |
// |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// The above copyright notice and this permission notice shall be included |
// sell copies of the Software, and to permit persons to whom the Software is |
// in all copies or substantial portions of the Software. |
// furnished to do so, subject to the following conditions: |
// |
// |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
// SOFTWARE OR THE USE OR OTHER 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. |
|
// | // |
//============================================================================== |
////////////////////////////////////////////////////////////////////////// |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <cstdio> | #include <cstdio> |
#include "InternalException.h" | #include "InternalException.h" |
|
#include "Constants.h" |
#include <Pegasus/Common/CIMExceptionRep.h> | #include <Pegasus/Common/CIMExceptionRep.h> |
#include <Pegasus/Common/ContentLanguageList.h> | #include <Pegasus/Common/ContentLanguageList.h> |
#include "Tracer.h" | #include "Tracer.h" |
|
|
_rep->message.append("): "); | _rep->message.append("): "); |
_rep->message.append(message); | _rep->message.append(message); |
| |
PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2, _rep->message); |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
(const char*)_rep->message.getCString()); |
} | } |
| |
AssertionFailureException::~AssertionFailureException() | AssertionFailureException::~AssertionFailureException() |
|
|
const char BadQualifierType::KEY[] = | const char BadQualifierType::KEY[] = |
"Common.InternalException.BAD_QUALIFIER_TYPE"; | "Common.InternalException.BAD_QUALIFIER_TYPE"; |
| |
const char ClassAlreadyResolved::MSG[] = |
|
"attempt to resolve a class that is already resolved: $0"; |
|
const char ClassAlreadyResolved::KEY[] = |
|
"Common.InternalException.CLASS_ALREADY_RESOLVED"; |
|
|
|
const char ClassNotResolved::MSG[] = "class is not yet resolved: $0"; |
|
const char ClassNotResolved::KEY[] = |
|
"Common.InternalException.CLASS_NOT_RESOLVED"; |
|
|
|
const char InstanceAlreadyResolved::MSG[] = |
|
"attempted to resolve a instance that is already resolved"; |
|
const char InstanceAlreadyResolved::KEY[] = |
|
"Common.InternalException.INSTANCE_ALREADY_RESOLVED"; |
|
|
|
const char InstantiatedAbstractClass::MSG[] = | const char InstantiatedAbstractClass::MSG[] = |
"attempted to instantiate an abstract class $0"; | "attempted to instantiate an abstract class $0"; |
const char InstantiatedAbstractClass::KEY[] = | const char InstantiatedAbstractClass::KEY[] = |
|
|
const char CannotOpenFile::MSG[] = "cannot open file: $0"; | const char CannotOpenFile::MSG[] = "cannot open file: $0"; |
const char CannotOpenFile::KEY[] = "Common.InternalException.CANNOT_OPEN_FILE"; | const char CannotOpenFile::KEY[] = "Common.InternalException.CANNOT_OPEN_FILE"; |
| |
|
const char CannotChangeFilePerm::MSG[] = |
|
"cannot change permissions of file: $0"; |
|
const char CannotChangeFilePerm::KEY[] = |
|
"Common.InternalException.CANNOT_CHANGE_FILE_PERM"; |
|
|
const char NotImplemented::MSG[] = "not implemented: $0"; | const char NotImplemented::MSG[] = "not implemented: $0"; |
const char NotImplemented::KEY[] = "Common.InternalException.NOT_IMPLEMENTED"; | const char NotImplemented::KEY[] = "Common.InternalException.NOT_IMPLEMENTED"; |
| |
|
|
const char StackOverflow::MSG[] = "stack overflow"; | const char StackOverflow::MSG[] = "stack overflow"; |
const char StackOverflow::KEY[] = "Common.InternalException.STACK_OVERFLOW"; | const char StackOverflow::KEY[] = "Common.InternalException.STACK_OVERFLOW"; |
| |
const char BadlyFormedCGIQueryString::MSG[] = "badly formed CGI query string"; |
|
const char BadlyFormedCGIQueryString::KEY[] = |
|
"Common.InternalException.BADLY_FORMED_CGI_QUERY_STRING"; |
|
|
|
const char DynamicLoadFailed::MSG[] = "load of dynamic library failed: $0"; | const char DynamicLoadFailed::MSG[] = "load of dynamic library failed: $0"; |
const char DynamicLoadFailed::KEY[] = | const char DynamicLoadFailed::KEY[] = |
"Common.InternalException.DYNAMIC_LOAD_FAILED"; | "Common.InternalException.DYNAMIC_LOAD_FAILED"; |
|
|
| |
const char InternalSystemError::MSG[] = "Unable to authenticate user"; | const char InternalSystemError::MSG[] = "Unable to authenticate user"; |
| |
|
const char SocketWriteError::MSG[] = "Could not write response to client. " |
|
"Client may have timed out. " |
|
"Socket write failed with error: $0"; |
|
const char SocketWriteError::KEY[] = |
|
"Common.InternalException.SOCKET_WRITE_ERROR"; |
|
|
|
const char TooManyElementsException::KEY[]= |
|
"Common.InternalException.TOO_MANY_ELEMENTS"; |
|
|
|
const char TooManyElementsException::MSG[]= |
|
"More than $0 elements in a container are not supported."; |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// TraceableCIMException | // TraceableCIMException |
|
|
String tmp = file; | String tmp = file; |
tmp.append("("); | tmp.append("("); |
char buffer[32]; | char buffer[32]; |
sprintf(buffer, "%d", line); |
sprintf(buffer, "%u", line); |
tmp.append(buffer); | tmp.append(buffer); |
tmp.append("): "); | tmp.append("): "); |
tmp.append(_makeCIMExceptionDescription(code, message)); | tmp.append(_makeCIMExceptionDescription(code, message)); |
|
|
// BadQualifierType | // BadQualifierType |
// | // |
//============================================================================== | //============================================================================== |
|
BadQualifierType::BadQualifierType( |
BadQualifierType::BadQualifierType(const String& qualifierName) |
const String& qualifierName, const String& className): |
: Exception(MessageLoaderParms(KEY, MSG, qualifierName)) |
Exception( |
|
MessageLoaderParms( |
|
KEY, |
|
MSG, |
|
className.size()==0?qualifierName: |
|
qualifierName+"(\""+className+"\")")), |
|
_qualifierName(qualifierName), |
|
_className(className) |
{ | { |
} | } |
|
const String& BadQualifierType:: getQualifierName() const |
BadQualifierType::~BadQualifierType() |
|
{ | { |
|
return _qualifierName; |
} | } |
|
const String& BadQualifierType:: getClassName() const |
//============================================================================== |
|
// |
|
// ClassAlreadyResolved |
|
// |
|
//============================================================================== |
|
|
|
ClassAlreadyResolved::ClassAlreadyResolved(const String& className) |
|
: Exception(MessageLoaderParms( |
|
ClassAlreadyResolved::KEY, |
|
ClassAlreadyResolved::MSG, |
|
className)) |
|
{ | { |
|
return _className; |
} | } |
|
BadQualifierType::~BadQualifierType() |
ClassAlreadyResolved::~ClassAlreadyResolved() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
|
// ClassNotResolved |
|
// |
|
//============================================================================== |
|
|
|
ClassNotResolved::ClassNotResolved(const String& className) |
|
: Exception(MessageLoaderParms( |
|
ClassNotResolved::KEY, |
|
ClassNotResolved::MSG, |
|
className)) |
|
{ |
|
} |
|
|
|
ClassNotResolved::~ClassNotResolved() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
|
// InstanceAlreadyResolved |
|
// |
|
//============================================================================== |
|
|
|
InstanceAlreadyResolved::InstanceAlreadyResolved() |
|
: Exception(MessageLoaderParms( |
|
InstanceAlreadyResolved::KEY, |
|
InstanceAlreadyResolved::MSG)) |
|
{ |
|
} |
|
|
|
InstanceAlreadyResolved::~InstanceAlreadyResolved() |
|
{ | { |
} | } |
| |
|
|
| |
//============================================================================== | //============================================================================== |
// | // |
|
// CannotChangeFilePerm |
|
// |
|
//============================================================================== |
|
|
|
CannotChangeFilePerm::CannotChangeFilePerm(const String& path) |
|
: Exception(MessageLoaderParms( |
|
CannotChangeFilePerm::KEY, |
|
CannotChangeFilePerm::MSG, |
|
path)) |
|
{ |
|
} |
|
|
|
CannotChangeFilePerm::~CannotChangeFilePerm() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
// NotImplemented | // NotImplemented |
// | // |
//============================================================================== | //============================================================================== |
|
|
| |
//============================================================================== | //============================================================================== |
// | // |
// BadlyFormedCGIQueryString |
|
// |
|
//============================================================================== |
|
|
|
BadlyFormedCGIQueryString::BadlyFormedCGIQueryString() |
|
: Exception(MessageLoaderParms( |
|
BadlyFormedCGIQueryString::KEY, |
|
BadlyFormedCGIQueryString::MSG)) |
|
{ |
|
} |
|
|
|
BadlyFormedCGIQueryString::~BadlyFormedCGIQueryString() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
|
// DynamicLoadFailed | // DynamicLoadFailed |
// | // |
//============================================================================== | //============================================================================== |
|
|
{ | { |
} | } |
| |
|
//============================================================================== |
|
// |
|
// SocketWriteError |
|
// |
|
//============================================================================== |
|
|
|
SocketWriteError::SocketWriteError(const String& error) |
|
: Exception(MessageLoaderParms( |
|
SocketWriteError::KEY, |
|
SocketWriteError::MSG, |
|
error)) |
|
{ |
|
} |
|
|
|
SocketWriteError::~SocketWriteError() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
|
// TooManyHTTPHeadersException |
|
// - used by HTTPAuthenticatorDelegator to report detection of more than |
|
// PEGASUS_MAXELEMENTS_NUM HTTP header fields in a single HTTP message |
|
//============================================================================== |
|
TooManyHTTPHeadersException::TooManyHTTPHeadersException() |
|
: Exception("more than "PEGASUS_MAXELEMENTS |
|
" header fields detected in HTTP message") |
|
{ |
|
} |
|
|
|
TooManyHTTPHeadersException::~TooManyHTTPHeadersException() |
|
{ |
|
} |
|
|
|
//============================================================================== |
|
// |
|
// TooManyElementsException |
|
// - used by OrderedSet to report detection of more than |
|
// PEGASUS_MAXELEMENTS_NUM elements in a single object |
|
//============================================================================== |
|
TooManyElementsException::TooManyElementsException() |
|
: Exception(MessageLoaderParms( |
|
TooManyElementsException::KEY, |
|
TooManyElementsException::MSG, |
|
PEGASUS_MAXELEMENTS_NUM)) |
|
{ |
|
} |
|
|
|
TooManyElementsException::~TooManyElementsException() |
|
{ |
|
} |
|
|
|
void ThrowTooManyElementsException() |
|
{ |
|
throw TooManyElementsException(); |
|
} |
|
|
|
void ThrowIndexOutOfBoundsException() |
|
{ |
|
throw IndexOutOfBoundsException(); |
|
} |
|
|
|
void ThrowUninitializedObjectException() |
|
{ |
|
throw UninitializedObjectException(); |
|
} |
|
|
|
void ThrowCannotOpenFileException(const char* path) |
|
{ |
|
throw CannotOpenFile(path); |
|
} |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |