Exception Handling
I searched so many sites now and i cant find what im doing wrong.
Im trying to create my own exception class.
My class would look like this.
class UserException : Exception
{
public UserException()
: base()
{
}
public UserException(string Message)
: base(Message)
{
}
}
And now im calling
throw new UserException("test");
in some function with a
catch (UserException e)
{
Console.WriteLine(e.Message);
}
But it looks like the 'throw' is always crashing. I get this windows thing "'program' has determined an error' or something like that. Whats wrong?
Thanks in advance...
Answers
Know the answer? Post it. Somebody with the same question will find it here.