Class ParsingException

All Implemented Interfaces:
Serializable

Indicates an error that occurred while parsing the configuration.

These exceptions can include a specific position reference within a file.

Since:
4.0.0
See Also:
  • Field Details

  • Constructor Details

    • 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 Details

    • 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
    • getMessage

      public @Nullable String getMessage()
      Description copied from class: ConfigurateException
      Get a description of the location of this error, with path included.
      Overrides:
      getMessage in class ConfigurateException
      Returns:
      message