Class ImageResourceException

All Implemented Interfaces:
OpenExceptionMeta, Serializable
Direct Known Subclasses:
ImageTimeoutException

public class ImageResourceException extends ImageException
Image Resource Exception 图片资源异常

Exception thrown when image processing resources are exhausted.

当图片处理资源耗尽时抛出的异常。

Features | 主要功能:

  • Exception for image resource exhaustion - 图片资源耗尽的异常
  • Carries ImageErrorCode for programmatic error handling - 携带 ImageErrorCode 用于编程式错误处理

Usage Examples | 使用示例:

// Catch specific exception
try {
    OpenImage.read(path);
} catch (ImageResourceException 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

    • ImageResourceException

      public ImageResourceException(String message)
      Create an image resource exception 创建图片资源异常
      Parameters:
      message - the error message | 错误消息
    • ImageResourceException

      public ImageResourceException(String message, Throwable cause)
      Create an image resource exception with cause 创建带原因的图片资源异常
      Parameters:
      message - the error message | 错误消息
      cause - the cause | 原因
    • ImageResourceException

      public ImageResourceException(String message, ImageErrorCode errorCode)
      Create an image resource exception with error code 创建带错误码的图片资源异常
      Parameters:
      message - the error message | 错误消息
      errorCode - the error code | 错误码
  • Method Details

    • tooManyRequests

      public static ImageResourceException tooManyRequests()
      Create exception for too many requests 创建请求过多的异常
      Returns:
      the exception | 异常
    • outOfMemory

      public static ImageResourceException outOfMemory()
      Create exception for out of memory 创建内存不足的异常
      Returns:
      the exception | 异常