Class ImageWriteException

All Implemented Interfaces:
Serializable

public class ImageWriteException extends ImageIOException
Image Write Exception 图片写入异常

Exception thrown when image writing fails.

当图片写入失败时抛出的异常。

Features | 主要功能:

  • Exception for image writing failures - 图片写入失败的异常
  • Carries ImageErrorCode for programmatic error handling - 携带 ImageErrorCode 用于编程式错误处理

Usage Examples | 使用示例:

// Catch specific exception
try {
    OpenImage.read(path);
} catch (ImageWriteException e) {
    System.err.println(e.getMessage());
}

Security | 安全性:

  • Thread-safe: Yes (immutable exception) - 线程安全: 是(不可变异常)
  • Null-safe: No (message must not be null) - 空值安全: 否(消息不能为 null)
Since:
JDK 25, opencode-base-image V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • ImageWriteException

      public ImageWriteException(String message)
      Create an image write exception 创建图片写入异常
      Parameters:
      message - the error message | 错误消息
    • ImageWriteException

      public ImageWriteException(Path path)
      Create an image write exception with path 创建带路径的图片写入异常
      Parameters:
      path - the file path | 文件路径
    • ImageWriteException

      public ImageWriteException(Path path, Throwable cause)
      Create an image write exception with path and cause 创建带路径和原因的图片写入异常
      Parameters:
      path - the file path | 文件路径
      cause - the cause | 原因
    • ImageWriteException

      public ImageWriteException(String message, Throwable cause)
      Create an image write exception with message and cause 创建带消息和原因的图片写入异常
      Parameters:
      message - the error message | 错误消息
      cause - the cause | 原因
  • Method Details

    • getPath

      public Path getPath()
      Get the file path 获取文件路径
      Returns:
      the file path or null | 文件路径或null