1package de.wroracer.uno.engine.error;
2
3public class UnoError extends Error { 4 public UnoError(String message) { 5 super(message); 6 } 7 8 public UnoError(String message, Throwable cause) { 9 super(message, cause);10 }1112 public UnoError(Throwable cause) {13 super(cause);14 }1516}
2
3import de.wroracer.uno.engine.card.Card;
4
5public class CardNotPlayableError extends UnoError {6 public CardNotPlayableError(Card play, Card current) {7 super("The card " + play + " is not playable on " + current);8 }9}
This class is an exception, but its name does not end in Exception
. This could be confusing to consumers of your API.
class BadName extends Exception {
// ...
}
class ActuallyAnException extends Exception {
// ...
}