Class ParsingException

    • Constructor Detail

      • ParsingException

        public ParsingException​(ConfigurationNode position,
                                int line,
                                int column,
                                String context,
                                @Nullable String message)
        Create a new parsing exception.
        Parameters:
        position - position in the node structure where the error occurred
        line - line with issue
        column - column in the line
        context - the line in a file where the error occurred
        message - message describing the error
        Since:
        4.0.0
      • ParsingException

        public ParsingException​(int line,
                                int column,
                                @Nullable String context,
                                @Nullable String message,
                                @Nullable Throwable cause)
        Create a new parsing exception.
        Parameters:
        line - line with issue
        column - column in the line
        context - the line in a file where the error occurred
        message - message describing the error
        cause - direct cause
        Since:
        4.0.0
      • ParsingException

        public ParsingException​(ConfigurationNode position,
                                int line,
                                int column,
                                @Nullable String context,
                                @Nullable String message,
                                @Nullable Throwable cause)
        Create a new parsing exception.
        Parameters:
        position - position in the node structure where the error occurred
        line - line with issue
        column - column in the line
        context - the line in a file where the error occurred
        message - message describing the error
        cause - direct cause
        Since:
        4.0.0
    • Method Detail

      • wrap

        public static ParsingException wrap​(ConfigurationNode source,
                                            IOException ex)
        Given an unknown IOException, return it as a Configurate type.

        If the input ex is already a ParsingException, this method returns the input value.

        Parameters:
        source - node where the source exception was thrown
        ex - the source exception
        Returns:
        an exception, either casted or wrapped
        Since:
        4.0.0
      • line

        public int line()
        Line most closely associated with this error.
        Returns:
        line, or -1 for unknown
        Since:
        4.0.0
      • column

        public int column()
        Column most closely associated with the error.
        Returns:
        column, or -1 for unknown
        Since:
        4.0.0
      • context

        public @Nullable String context()
        A context line from the source, if available.
        Returns:
        context line
        Since:
        4.0.0