Class ImageException

All Implemented Interfaces:
OpenExceptionMeta, Serializable
Direct Known Subclasses:
ImageFormatException, ImageIOException, ImageOperationException, ImageResourceException, ImageValidationException

public class ImageException extends OpenException
Image Exception - Base exception for all image processing exceptions 图片异常基类 - 所有图片处理异常的基类

Base exception class for all image processing exceptions. Extends OpenException to integrate with the unified OpenCode exception hierarchy.

所有图片处理异常的基类。继承 OpenException 以集成到统一的 OpenCode 异常体系中。

Features | 主要功能:

  • Base exception for all image processing errors - 所有图片处理错误的基础异常
  • Carries ImageErrorCode for programmatic error handling - 携带 ImageErrorCode 用于编程式错误处理
  • Integrates with OpenException (component="Image") - 集成 OpenException(组件="Image")

Usage Examples | 使用示例:

// Catch specific exception
try {
    OpenImage.read(path);
} catch (ImageException e) {
    System.err.println(e.getRawMessage());
    ImageErrorCode code = e.getImageErrorCode();
}

Security | 安全性:

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

    • ImageException

      public ImageException(String message, ImageErrorCode errorCode)
      Create an image exception with message and error code 创建带消息和错误码的图片异常
      Parameters:
      message - the error message | 错误消息
      errorCode - the error code | 错误码
    • ImageException

      public ImageException(String message, Throwable cause, ImageErrorCode errorCode)
      Create an image exception with message, cause and error code 创建带消息、原因和错误码的图片异常
      Parameters:
      message - the error message | 错误消息
      cause - the cause | 原因
      errorCode - the error code | 错误码
    • ImageException

      public ImageException(String message)
      Create an image exception with message 创建带消息的图片异常
      Parameters:
      message - the error message | 错误消息
    • ImageException

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