Sunshine

Sunshine

  • NA
  • 201
  • 26.6k

Exception Class

Oct 15 2015 12:48 PM
Hi,

I have an Exception Class as below.

[code]using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class MyException : Exception
    {
    }
}[/code]

I call this class as below

[code]if (result == false)
            {
                throw new MyException();
            }[/code]

But I get an error that says 'Unhandled exception has occured in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.

Exception of type Test.MyException was thrown.

Please help.

Thanks

Answers (3)