The point of having custom exception types is to convey more information than is available in standard types. But custom exception types must be
public for that to work.
If a method throws a non-public exception, the best you can do on the caller’s side is to
catch the closest
of the class. That is, you lose all that custom information you created the exception type to pass.
Noncompliant Code Example
internal class MyException : Exception // Noncompliant
public class MyException : Exception
This rule ignores Exception types that are not derived directly from