InternalServerError is an Exception but is not named appropriately
1package io.example.domain.exception;
2
3public class InternalServerError extends RuntimeException { 4 5 public InternalServerError() { 6 } 7 8 public InternalServerError(String message) { 9 super(message);10 }1112 public InternalServerError(String message, Throwable cause) {13 super(message, cause);14 }1516 public InternalServerError(Throwable cause) {17 super(cause);18 }1920}
Description
This class is an exception, but its name does not end in Exception
. This could be confusing to consumers of your API.
Bad Practice
class BadName extends Exception {
// ...
}
Recommended
class ActuallyAnException extends Exception {
// ...
}