java.lang.Error
SC-R1045Error
s represent situations that are difficult to recover from. Therefore, it is recommended that you do not extend java.lang.Error
and instead inherit from java.lang.Exception
to denote custom errors/exceptions.
// A very minimal example depicting custom error
class SomeError extends Error
// An example of a custom exception
class MyCustomException extends Exception