//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2008 - 2009 All Rights Reserved.
//
// File: CimException.cs
//
// Contents: CimException is a part of the CimFramework project.
// It contains the definitions of the exceptions used in the framework.
//
//----------------------------------------------------------------------------
using System;
using Intel.Manageability.WSManagement;
namespace Intel.Manageability.Exceptions
{
///
/// Class that represents a logical error in the framework.
///
public class CimException : Exception
{
///
/// A struct that represents the WS-Management fault data
///
public Fault CimFault{get; set;}
///
/// Constructor
///
/// Error message
public CimException(String msg): base("Logic error:\n"+msg){}
///
/// Copy constructor
///
/// Object to be copied.
public CimException(Exception other) : base(other.Message, other) { }
///
/// Constructor
///
/// Error details
/// Other exception to be copied
public CimException(Fault CimFaultOther, Exception ex)
: base("CimFault.Code: " + CimFaultOther.Code.Value + " CimFault.SubCode: " + CimFaultOther.Code.Subcode.Value, ex)
{
CimFault = CimFaultOther;
}
///
/// Constructor
///
/// Error details
public CimException(Fault CimFaultOther)
: base("CimFault.Code: " + CimFaultOther.Code.Value + " CimFault.SubCode: " + CimFaultOther.Code.Subcode.Value)
{
CimFault = CimFaultOther;
}
}
///
/// Class that represents a property access error in the framework.
///
public class CimPropertyException : CimException
{
///
/// Constructor
///
/// Error message
public CimPropertyException(String msg): base(msg){}
///
/// Constructor
///
/// Other exception to be copied
public CimPropertyException(Exception other) : base(other) { }
}
}