Class ArgumentSyntaxException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.minestom.server.command.builder.exception.ArgumentSyntaxException
All Implemented Interfaces:
Serializable

public class ArgumentSyntaxException extends RuntimeException
Exception triggered when an Argument is wrongly parsed.

Retrieved in ArgumentCallback defined in Command.setArgumentCallback(ArgumentCallback, Argument).

Be aware that the message returned by Throwable.getMessage() is only here for debugging purpose, you should refer to getErrorCode() to identify the exceptions.

See Also:
  • Constructor Details

    • ArgumentSyntaxException

      public ArgumentSyntaxException(@NotNull @NotNull String message, @NotNull @NotNull String input, int errorCode)
  • Method Details

    • fillInStackTrace

      public Throwable fillInStackTrace()
      Overrides:
      fillInStackTrace in class Throwable
    • getInput

      @NotNull public @NotNull String getInput()
      Gets the problematic command input.
      Returns:
      the command input which triggered the exception
    • getErrorCode

      public int getErrorCode()
      Gets the error code of the exception.

      The code is decided arbitrary by the argument, check the argument class to know the meaning of each one.

      Returns:
      the argument error code