Skip to content

Gendarme.Rules.Exceptions.ExceptionShouldBeVisibleRule(2.10)

Sebastien Pouliot edited this page Feb 9, 2011 · 3 revisions

ExceptionShouldBeVisibleRule

Assembly: Gendarme.Rules.Exceptions
Version: 2.10

Description

This rule checks for non-visible exceptions which derive directly from the most basic exceptions: System.Exception, System.ApplicationException or System.SystemException. Those basic exceptions, being visible, will be the only information available to the API consumer - but do not contain enough data to be useful.

Examples

Bad example:

internal class GeneralException : Exception {
}

Good example (visibility):

public class GeneralException : Exception {
}

Good example (base class):

internal class GeneralException : ArgumentException {
}

Notes

  • This rule is available since Gendarme 2.0
Clone this wiki locally