
Contents
|
In file ../../src/Pegasus/Common/Exception.h:
The CIMException class models an error response to a CIM operation
Documentation
The CIMException class models an error response to a CIM operation
Inheritance:
Public Methods
| CIMException ( CIMStatusCode code = CIM_ERR_SUCCESS, const String& message = String::EMPTY)
Constructs a CIMException with a status code and error description message.
|
| CIMException ( CIMStatusCode code, const String& message, const CIMInstance& instance)
Constructs a CIMException with a status code, error description message, and a CIM_Error instance attached to the exception.
|
| CIMException ( CIMStatusCode code, const String& message, const Array<CIMInstance>& instances)
Constructs a CIMException with a status code, error description message, and an Array of CIM_Error instances attached to the exception.
|
| CIMException (const CIMException& cimException)
Constructs a CIMException by copying another CIMException object.
|
CIMException& | operator= (const CIMException& cimException)
Assigns the value from a specified CIMException object.
|
virtual | ~CIMException ()
Destructs a CIMException object
|
CIMStatusCode | getCode () const
Gets the CIMStatusCode for the current CIMException.
|
Uint32 | getErrorCount () const
Gets the count of CIM_Error instances attached to the CIMException.
|
CIMConstInstance | getError (Uint32 index) const
Gets a single CIM_Error instance that is attached to the CIMException.
|
void | addError (const CIMInstance& instance)
Adds a CIM_Error instance to a CIMException.
|
Public Methods-
virtual const String& getMessage() const
Protected Fields-
ExceptionRep* _rep
CIMException( CIMStatusCode code = CIM_ERR_SUCCESS, const String& message = String::EMPTY)
-
Constructs a CIMException with a status code and error description
message.
- Parameters:
- code - A CIMStatusCode containing a DMTF defined status code
specifying the type of the error
message - A message String containing a more specific description
of the error
CIMException( CIMStatusCode code, const String& message, const CIMInstance& instance)
-
Constructs a CIMException with a status code, error description
message, and a CIM_Error instance attached to the exception.
- Parameters:
- code - A CIMStatusCode containing a DMTF defined status code
specifying the type of the error
message - A message String containing a more specific description
of the error
instance - A CIMInstance containing the CIM_Error instance to be
added to the CIMException. This instance is NOT validated for
type correctness nor correlation with the specified status code
and error description.
CIMException( CIMStatusCode code, const String& message, const Array<CIMInstance>& instances)
-
Constructs a CIMException with a status code, error description
message, and an Array of CIM_Error instances attached to the exception.
- Parameters:
- code - A CIMStatusCode containing a DMTF defined status code
specifying the type of the error
message - A message String containing a more specific description
of the error
instances - An Array of CIMInstance objects containing the
CIM_Error instances to be added to the CIMException. These
instances are NOT validated for type correctness nor correlation
with the specified status code and error description.
CIMException(const CIMException& cimException)
-
Constructs a CIMException by copying another CIMException object.
- Parameters:
- cimException - The CIMException object to copy
CIMException& operator=(const CIMException& cimException)
-
Assigns the value from a specified CIMException object.
- Parameters:
- cimException - The CIMException object to copy
- Returns:
- A reference to this CIMException object with the new assignment
virtual ~CIMException()
-
Destructs a CIMException object
CIMStatusCode getCode() const
-
Gets the CIMStatusCode for the current CIMException. This is the
code that defines the ERROR that was executed and transmitted
to the Client.
- Returns:
- a single CIMStatusCode
Uint32 getErrorCount() const
-
Gets the count of CIM_Error instances attached to the CIMException.
Normally this method is used by a client to determine if any
CIM_Error instances are attached to a CIMException.
- Returns:
- Uint32 count of CIM_Error instances attached to the
CIMException.
CIMConstInstance getError(Uint32 index) const
-
Gets a single CIM_Error instance that is attached to the CIMException.
Example:
try
{
... Execute CIM Operation
}
catch (CIMException& e)
{
for (Uint32 i = 0 ; i < e.getErrorCount() ; i++)
... process e.getError(i)
}
- Throws:
- IndexOutOfRangeException If the index is greater or equal to
the number of CIM_Error instances attached to the CIMExcepton.
- Parameters:
- index - A Uint32 index specifying the index of the CIM_Error
instance to get from the CIMException. The index must be less than
the getErrorCount() return value.
- Returns:
- A CIMConstInstance containing the CIM_Error instance at the
specified index.
void addError(const CIMInstance& instance)
-
Adds a CIM_Error instance to a CIMException.
- Parameters:
- instance - A CIMInstance containing the CIM_Error instance to be
added to the CIMException. This instance is NOT validated for
type correctness nor correlation with the status code and error
description already set in the CIMException.
- Direct child classes:
- CIMOperationFailedException
Alphabetic index HTML hierarchy of classes or Java
|