Support Center & Knowledge base

DL0004

ExceptionShouldNotBeSuffixed

Exceptions, as with everything in code, should have proper names telling exactly what its purpose is. With a proper name, the need for a suffix saying what technical construct it is goes away.

Example of good names for exceptions:

  • WriteableImmutableFieldsFound
  • WriteableImmutablePropertiesFound
  • InvalidVersionString
  • UnableToProvideConfigurationObject
  • CannotInvokeMethodBecauseTargetIsNotAlive

Consider the name a rule that was broken. Exceptions are not meant to control program flow, but represent something that is fundamentally unrecoverable. As you can also see with the naming is that they’re very specific, generic exceptions are to be avoided. Read more about this in DL0008.