Class CommandMessageException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
tech.guilhermekaua.spigotboot.commands.CommandMessageException
All Implemented Interfaces:
Serializable

public class CommandMessageException extends RuntimeException
Raised by a CommandArgumentResolver to signal a specific, customizable failure. The carried CommandMessageKey and placeholder values are rendered into the final message by the command pipeline, letting a downstream CommandMessageSource override the text per key.
See Also:
  • Method Details

    • of

      Parameters:
      key - the message key describing this failure; must not be null
      Returns:
      a new exception carrying key and no placeholders yet
    • with

      public CommandMessageException with(String name, Object value)
      Binds a placeholder value for rendering.
      Parameters:
      name - the placeholder name (without braces); must not be null
      value - the value; may be null
      Returns:
      this exception, for chaining
    • getKey

      public CommandMessageKey getKey()
      Returns:
      the key describing this failure
    • getPlaceholders

      public Map<String,Object> getPlaceholders()
      Returns:
      an unmodifiable view of the bound placeholder values
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable