Package studio.mevera.imperat.exception
Class ResponseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
studio.mevera.imperat.exception.CommandException
studio.mevera.imperat.exception.ResponseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ArgumentParseException
Base class for all exceptions whose user-facing message is driven by the
ResponseRegistry — i.e. argument parsing
failures, flag errors, validation violations, and cooldowns.
The central throwable resolver handles every ResponseException uniformly:
it looks up the ResponseKey in the registry and sends the resolved content
(with placeholders) to the source.
NOT for structural/flow exceptions like InvalidSyntaxException
or PermissionDeniedException — those extend CommandException directly
and carry their own plain message.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResponseException(@NotNull ResponseKey responseKey) protectedResponseException(@NotNull ResponseKey responseKey, @Nullable PlaceholderDataProvider placeholderDataProvider) -
Method Summary
Modifier and TypeMethodDescription@Nullable PlaceholderDataProvider@NotNull ResponseKeyGuaranteed non-null — everyResponseExceptionmust carry a key.static ResponseExceptionof(@NotNull ResponseKey responseKey) Factory for creating an inlineResponseExceptionwith the given key.<S extends CommandSource>
ResponseExceptionwithPlaceholder(String key, String value) withPlaceholder(String key, Supplier<String> valueSupplier) withPlaceholder(Placeholder placeholder) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ResponseException
- Parameters:
responseKey- the registry key used to look up the response message
-
ResponseException
protected ResponseException(@NotNull @NotNull ResponseKey responseKey, @Nullable @Nullable PlaceholderDataProvider placeholderDataProvider)
-
-
Method Details
-
of
Factory for creating an inlineResponseExceptionwith the given key. -
getResponseKey
Guaranteed non-null — everyResponseExceptionmust carry a key. -
getPlaceholderDataProvider
-
withPlaceholder
-
withPlaceholder
-
withContextPlaceholders
-
withPlaceholder
-