Class YmlParseException

All Implemented Interfaces:
OpenExceptionMeta, Serializable

public class YmlParseException extends OpenYmlException
YAML Parse Exception - Thrown when YAML parsing fails YAML 解析异常 - 当 YAML 解析失败时抛出

This exception is thrown when the YAML content has syntax errors or format issues.

当 YAML 内容存在语法错误或格式问题时抛出此异常。

Features | 主要功能:

  • Inherits line/column location from OpenYmlException - 从 OpenYmlException 继承行/列位置
  • Wraps underlying parser exceptions - 包装底层解析器异常
  • Error code YML_PARSE_001 - 错误码 YML_PARSE_001

Usage Examples | 使用示例:

try {
    OpenYml.parse(invalidYaml);
} catch (YmlParseException e) {
    System.err.println("Parse error: " + e.getMessage());
}

Security | 安全性:

  • Thread-safe: Yes (immutable after construction) - 线程安全: 是(构建后不可变)
  • Null-safe: No (message may be null) - 空值安全: 否(消息可能为空)
Since:
JDK 25, opencode-base-yml V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • YmlParseException

      public YmlParseException(String message)
      Constructs a parse exception with message. 构造带消息的解析异常。
      Parameters:
      message - the detail message | 详细消息
    • YmlParseException

      public YmlParseException(String message, int line, int column)
      Constructs a parse exception with message and location. 构造带消息和位置的解析异常。
      Parameters:
      message - the detail message | 详细消息
      line - the line number | 行号
      column - the column number | 列号
    • YmlParseException

      public YmlParseException(String message, Throwable cause)
      Constructs a parse exception with message and cause. 构造带消息和原因的解析异常。
      Parameters:
      message - the detail message | 详细消息
      cause - the cause | 原因
    • YmlParseException

      public YmlParseException(String message, Throwable cause, int line, int column)
      Constructs a parse exception with message, cause and location. 构造带消息、原因和位置的解析异常。
      Parameters:
      message - the detail message | 详细消息
      cause - the cause | 原因
      line - the line number | 行号
      column - the column number | 列号