Class KamiCommonException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.kamikazejam.kamicommon.util.exception.KamiCommonException
- All Implemented Interfaces:
Serializable
A checked exception whose payload is a message for the sender rather than a stack trace. Throw it from a
Type or from a command's perform method to
stop execution and tell the sender why; the command framework catches it, sends the attached message if
there is one, and prints nothing to the console. Construct it empty and attach the message with one of
the addMsg methods, each of which returns this for chaining.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull KamiCommonExceptionaddMsg(@NotNull VersionedComponent msg) @NotNull KamiCommonExceptionDeprecated.@NotNull KamiCommonExceptionDeprecated.UseaddMsgFromLegacyColors(String, Object...)instead for clarity@NotNull KamiCommonExceptionaddMsgFromLegacyColors(@Nullable String msg) @NotNull KamiCommonExceptionaddMsgFromLegacyColors(@Nullable String msg, Object... args) @NotNull KamiCommonExceptionaddMsgFromMiniMessage(@Nullable String miniMessage) @NotNull KamiCommonExceptionaddMsgFromMiniMessage(@Nullable String miniMessage, Object... args) @NotNull KamiCommonExceptionaddMsgFromPlainText(@Nullable String plainText) @Nullable VersionedComponent@Nullable StringbooleanMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
message
-
-
Constructor Details
-
KamiCommonException
public KamiCommonException()
-
-
Method Details
-
hasMessage
public boolean hasMessage() -
getMessage
- Overrides:
getMessagein classThrowable
-
getComponent
-
addMsg
Deprecated.UseaddMsgFromLegacyColors(String)instead for clarity -
addMsgFromLegacyColors
-
addMsg
@Deprecated @NotNull public @NotNull KamiCommonException addMsg(@Nullable @Nullable String msg, Object... args) Deprecated.UseaddMsgFromLegacyColors(String, Object...)instead for clarity -
addMsgFromLegacyColors
@NotNull public @NotNull KamiCommonException addMsgFromLegacyColors(@Nullable @Nullable String msg, Object... args) -
addMsg
-
addMsgFromMiniMessage
@NotNull public @NotNull KamiCommonException addMsgFromMiniMessage(@Nullable @Nullable String miniMessage) -
addMsgFromMiniMessage
@NotNull public @NotNull KamiCommonException addMsgFromMiniMessage(@Nullable @Nullable String miniMessage, Object... args) -
addMsgFromPlainText
@NotNull public @NotNull KamiCommonException addMsgFromPlainText(@Nullable @Nullable String plainText)
-
addMsgFromLegacyColors(String)instead for clarity