Class ImageOperationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.image.exception.ImageException
cloud.opencode.base.image.exception.ImageOperationException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
Image Operation Exception
图片操作异常
Exception thrown when image operations (resize, crop, rotate, etc.) fail.
当图片操作(缩放、裁剪、旋转等)失败时抛出的异常。
Features | 主要功能:
- Exception for image operation failures (resize, crop, etc.) - 图片操作失败的异常(缩放、裁剪等)
- Carries ImageErrorCode for programmatic error handling - 携带 ImageErrorCode 用于编程式错误处理
Usage Examples | 使用示例:
// Catch specific exception
try {
OpenImage.read(path);
} catch (ImageOperationException 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 Summary
ConstructorsConstructorDescriptionImageOperationException(String message) Create an image operation exception 创建图片操作异常ImageOperationException(String message, ImageErrorCode errorCode) Create an image operation exception with error code 创建带错误码的图片操作异常ImageOperationException(String message, String operation) Create an image operation exception with operation name 创建带操作名称的图片操作异常ImageOperationException(String message, Throwable cause) Create an image operation exception with cause 创建带原因的图片操作异常ImageOperationException(String message, Throwable cause, ImageErrorCode errorCode) Create an image operation exception with cause and error code 创建带原因和错误码的图片操作异常 -
Method Summary
Methods inherited from class ImageException
getImageErrorCodeMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OpenExceptionMeta
getMetaPrefix
-
Constructor Details
-
ImageOperationException
Create an image operation exception 创建图片操作异常- Parameters:
message- the error message | 错误消息
-
ImageOperationException
-
ImageOperationException
Create an image operation exception with error code 创建带错误码的图片操作异常- Parameters:
message- the error message | 错误消息errorCode- the error code | 错误码
-
ImageOperationException
-
ImageOperationException
Create an image operation exception with cause and error code 创建带原因和错误码的图片操作异常- Parameters:
message- the error message | 错误消息cause- the cause | 原因errorCode- the error code | 错误码
-
-
Method Details
-
getOperation
Get the operation name 获取操作名称- Returns:
- the operation name or null | 操作名称或null
-