Microsoft .NET Framework already has a good number of exceptions that can be raised that you are able to trap. But there may be instances where you'll require a custom exception that provides more detailed information or that is more end user friendly in its terminology.
So, we are now going to look at what the requirements are for building our own custom exceptions. It is surprisingly simple to build your own custom exception. All you have to do is give your class a name that ends with Exception and inherit from System.Exception. Then, you need to add three constructors, as shown in the following code example:
public class TickerListNotFoundException : Exception
{
public TickerListNotFoundException() : base()
{
}
public TickerListNotFoundException(string message)
: base(message)
{
}
public TickerListNotFoundException(
string message,
...