Class CacheException
It is the base class for all the exceptions that are thrown from NCache. So you can catch this exception for all the exceptions thrown from within the NCache.
Inheritance
System.Object
System.Exception
CacheException
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
[Serializable]
public class CacheException : Exception, ISerializable, _Exception
Examples
The following example demonstrates how to use this exception in your code.
try
{
...
}
catch(CacheException ex)
{
...
}
CacheException()
default constructor.
Declaration
public CacheException()
CacheException(SerializationInfo, StreamingContext)
overloaded constructor, manual serialization.
Declaration
protected CacheException(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |
CacheException(String)
overloaded constructor, takes the reason as parameter.
Declaration
public CacheException(string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason |
CacheException(String, Exception)
overloaded constructor.
Declaration
public CacheException(string reason, Exception inner)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | reason for exception |
System.Exception | inner | nested exception |
GetObjectData(SerializationInfo, StreamingContext)
manual serialization
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |
Overrides
System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)