R
rodchar
hey all,
i have a very simple custom exception class:
public class EmptyRecordException : Exception
{
string message;
public override string Message
{
get
{
return message;
}
}
public EmptyRecordException(string message)
{
this.message = message;
}
}
Here's how i try to throw it:
public void ThrowMockException()
{
throw new EmptyRecordException("message from c2");
}
i'm trying to catch it this way:
catch (EmptyRecordException ex)
{
throw ex.Message;
}
but it is giving me an error saying:
The type caught or thrown must be derived from System.Exception
any ideas?
thanks,
rodchar
i have a very simple custom exception class:
public class EmptyRecordException : Exception
{
string message;
public override string Message
{
get
{
return message;
}
}
public EmptyRecordException(string message)
{
this.message = message;
}
}
Here's how i try to throw it:
public void ThrowMockException()
{
throw new EmptyRecordException("message from c2");
}
i'm trying to catch it this way:
catch (EmptyRecordException ex)
{
throw ex.Message;
}
but it is giving me an error saying:
The type caught or thrown must be derived from System.Exception
any ideas?
thanks,
rodchar