Class SNBTException

java.lang.Object
java.lang.Throwable
java.lang.Exception
de.pauleff.formats.snbt.SNBTException
All Implemented Interfaces:
Serializable

public class SNBTException extends Exception
Exception thrown when parsing or generating SNBT (Stringified NBT) data fails. Provides position information for better error reporting.
See Also:
  • Constructor Details

    • SNBTException

      public SNBTException(String message)
      Creates an SNBT exception with a message.
      Parameters:
      message - the error message
    • SNBTException

      public SNBTException(String message, int position, String input)
      Creates an SNBT exception with position information.
      Parameters:
      message - the error message
      position - the character position where the error occurred
      input - the input string being parsed
    • SNBTException

      public SNBTException(String message, Throwable cause)
      Creates an SNBT exception with a message and underlying cause.
      Parameters:
      message - the error message
      cause - the underlying exception that caused this error
    • SNBTException

      public SNBTException(String message, int position, String input, Throwable cause)
      Creates an SNBT exception with position information and underlying cause.
      Parameters:
      message - the error message
      position - the character position where the error occurred
      input - the input string being parsed
      cause - the underlying exception that caused this error
  • Method Details

    • getPosition

      public int getPosition()
      Returns the character position where the error occurred.
      Returns:
      the error position, or -1 if not available
    • getInput

      public String getInput()
      Returns the input string that was being parsed when the error occurred.
      Returns:
      the input string, or null if not available