Custom Exceptions
If none of the built-in exceptions are suitable for your needs, you can create your own custom exception types.
A custom exception is a class that inherits from the Exception class, which has several constructors that allow you to specify the message and inner exception.
class InsufficientFundsException : Exception {
public InsufficientFundsException() : base("Insufficient funds") { }
public InsufficientFundsException(string message) : base(message) { }
public InsufficientFundsException(string message, Exception? innerException) : base(message, inner) { }
}