Class ParsingException

  • All Implemented Interfaces:
    Serializable

    @NonExtendable
    public abstract class ParsingException
    extends RuntimeException
    An exception thrown when an error occurs while parsing a MiniMessage string.
    Since:
    4.10.0
    See Also:
    Serialized Form
    • Constructor Detail

      • ParsingException

        protected ParsingException​(@Nullable
                                   @Nullable String message)
        Create a new parsing exception with only a message.
        Parameters:
        message - a detail message describing the error
        Since:
        4.10.0
      • ParsingException

        protected ParsingException​(@Nullable
                                   @Nullable String message,
                                   @Nullable
                                   @Nullable Throwable cause)
        Create a new parsing exception with a message and an optional cause.
        Parameters:
        message - a detail message describing the error
        cause - the cause
        Since:
        4.10.0
    • Method Detail

      • originalText

        @NotNull
        public abstract @NotNull String originalText()
        Get the input message which caused this exception.
        Returns:
        the original input message
        Since:
        4.10.0
      • detailMessage

        @Nullable
        public abstract @Nullable String detailMessage()
        Get the detail message optionally passed with this exception.

        Unlike Throwable.getMessage(), this method does not include location information.

        Returns:
        the detail message passed to this exception
        Since:
        4.10.0
      • startIndex

        public abstract int startIndex()
        Get the start index of the location which caused this exception.

        This index is an index into originalText(). If location is unknown, LOCATION_UNKNOWN will be returned instead.

        Returns:
        the start index
        Since:
        4.10.0
      • endIndex

        public abstract int endIndex()
        Get the end index of the location which caused this exception.

        This index is an index into originalText(). If location is unknown, LOCATION_UNKNOWN will be returned instead.

        Returns:
        the end index
        Since:
        4.10.0