Think about it ... How far does the chain go? If an exception is selected from a public function, it must be public.
However, if the exception is always caught in your library and has never been thrown or was not reused or thrown like anything else, it may be internal.
Ideally, I would have a scenario like this:
namespace MyAPI { public class PublicException : System.Exception { }
Thus, users of my API have the opportunity to catch any exception that I throw. Domestic never make it this far.
source share