application Exceptions

  • Thread starter Thread starter Ran Y
  • Start date Start date
R

Ran Y

hello all,
we are writing a class lib dll and want to use our own new app exception.

we want them to have the same 'Message' and "InnerException' members as all
Exceptions have.

we cant override these members because they are 'read only'....

any suggestions ?
what do you do ??

thanks, Ran.
 
If you derive your exception class from System.Exception or one if its
descendants (as you should) you will automatically get the members Message
and InnerException. What are you trying to do that this wont do for you?
 
The point is overriding getter to return whatever you want, like that
string Messag

ge

return base.Message+"\nCool Message Description"

}
 
The Message property is already virtual so you can override it and return
any message you want.
 
Back
Top