Cheryl,
While it is possible to throw an instance of any type in the CLR, in C#,
you are limited to throwing objects that derive from Exception. If you need
more information, you can set the Message property of the Exception class.
However, you should try and find an exception that is already defined
that matches your condition, and use that. If not, then you should derive
from the Exception (or ApplicationException) class, so that types of your
exception can be caught (this would be the indicator of the particular
condition that you have, not the Message).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Cheryl" <ch********@aol.com> wrote in message
news:77**************************@posting.google.c om...
If I throw ex it does not give me enought informtion, if I throw
strmessage would this actually throw the message that I've created
plus the ex.message string?
catch(Exception ex)
{
strmessage = "Error Logger.Instance.LogError: " +
ex.message;
throw strmessage;
}