Exception
s should always be public
CS-W1004Exception
s are not limited to a part of the codebase and can be thrown and caught anywhere. It is therefore recommended that your custom Exception
s always be declared as public
. Otherwise, you'd have to catch
the closest accessible public
exception.
internal class MyCustomException: Exception
{
}
public class MyCustomException: Exception
{
}