Custom Exception that processes Message
Posted on: Thu Feb 18 16:06:22 -0800 2010. Updated on: Thu Feb 18 16:07:06 -0800 2010.
Category: DotNet
Category: DotNet
Here is a basic example of a custom exception that can have the message property assigned to.
public class PresentationException : Exception, ISerializable
{
public override string Message
{
get
{
return _message;
}
}
private string _message;
public PresentationException()
{
}
public PresentationException(string message)
{
_message = message;
}
public PresentationException(string message, Exception inner)
{
_message = message;
}
// This constructor is needed for serialization.
protected PresentationException(SerializationInfo info, StreamingContext context)
{
}
}