Class ArgumentNotAvailableException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
eu.cloudnetservice.node.command.exception.ArgumentNotAvailableException
All Implemented Interfaces:
Serializable

public class ArgumentNotAvailableException extends RuntimeException
This exception is used when argument parsers need to hard fail the argument parsing because there is a syntax error. The message of the exception is sent to the user therefore it should be translated and formatted correctly.

Note: The fillInStackTrace() method is empty, therefore the creation of this exception is not heavy, and it can be used frequently.

Since:
4.0
See Also:
  • Constructor Details

    • ArgumentNotAvailableException

      public ArgumentNotAvailableException(@NonNull @NonNull String message)
      Constructs a new exception for argument parse failing.
      Parameters:
      message - the message to send to the user.
      Throws:
      NullPointerException - if message is null.
  • Method Details

    • fillInStackTrace

      @NonNull public @NonNull Throwable fillInStackTrace()
      Returns the own instance of this exception without filling the stacktrace, as the stacktrace is not needed for this exception.
      Overrides:
      fillInStackTrace in class Throwable
      Returns:
      this instance for chaining.