overriding exception message
- From: "andrewcw" <andrewcw@xxxxxxx>
- Date: Fri, 27 Jan 2006 15:06:27 -0800
I wanted to create an exception handler for certain processing I do - but
although I can 'throw' to the constructor with a parameter, I cannot
override the exception message property, the error says its read only. How
can or if a person can create the override ?
class privateException: Exception
{
public privateException(string str)
{
Console.WriteLine("User Defined Exception" +
this.Message+this.StackTrace);
// this.Message=" Special Error " + str
// you cannot seem to create modify the message.
// this input could cause some additional interaction - maybe here
// would be where a file could be written
}
public privateException()
{
}
}
--
Andrew
.
- Follow-Ups:
- Re: overriding exception message
- From: Jon Skeet [C# MVP]
- Re: overriding exception message
- From: chris martin
- Re: overriding exception message
- Prev by Date: Re: BeginAccept doesn't work
- Next by Date: Re: Excel & Office Integration
- Previous by thread: IEnumerable Item Count
- Next by thread: Re: overriding exception message
- Index(es):
Relevant Pages
|