Custom Exception

An application-specific exception type created by extending an exception class.

What is Custom Exception in C#?

Custom Exception — An application-specific exception type created by extending an exception class.

class Reservation
{
    void Reserve(int seats)
    {
        if (seats < 1)
        {
            throw new ArgumentException("Seat count must be positive");
        }
    }
}

Level: Journeyman · More C# terms at this level

Updated

In other subjects