C#

C#

Made by DeepSource

Missing implementation of System.Exception CS-R1109

Anti-pattern
Major

Inheriting System.Exception class allows you to define your own custom exceptions. This is particularly useful for scenarios where you believe that the exceptions supplied in the standard library are not suitable for your use cases. The norm is that such user-defined exception's name end with the word Exception such as EmployeeListNotFoundException. However, in this case, such a class was found to not inherit System.Exception. Either consider inheriting it, or, renaming your class to avoid confusion.

Bad Practice

class EmployeeListNotFoundException
{
}

Recommended

class EmployeeListNotFoundException: Exception
{
    // ...
}

Reference