Avi Ozer

Avi Ozer

  • NA
  • 1
  • 0

How can implement class which derived from system.exeption?

Jan 28 2006 11:27 AM
I tried to implement that code:

try
{
  CheckDivideByZero(num1, num2);
}
catch (FirstDivideByZeroException)
{
  Console.WriteLine("first number is zero");
}

I need  that, FirstDivideByZeroException class will handle that Exeption instead of DevideByZeroExeption.
I tried to do that:

public  class
FirstDivideByZeroException : DivideByZeroException {}

but when i run the application, that message appear:
"An unhandled exception of type 'System.DivideByZeroException' occurred .."


How can i implement that?

Answers (1)