Restrict the number of exceptions a method may throw.
Default = 1.
Exceptions form part of a methods interface. Declaring
a method to throw too many differently rooted
exceptions makes exception handling onerous and leads
to poor programming practices such as catch
(Exception). This check forces developers to put
exceptions into a heirachy such that in the simplest
case, only one type of exception need be checked for by
a caller but allows any sub-classes to be caught
specifically if necessary.
Log in to post a comment.