Class GraphException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.graph.exception.GraphException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
- Direct Known Subclasses:
CycleDetectedException, EdgeNotFoundException, GraphLimitExceededException, GraphTimeoutException, InvalidEdgeException, InvalidVertexException, NoPathException, VertexNotFoundException
Graph Exception
图异常基类
Base exception class for all graph-related exceptions.
所有图相关异常的基类。
Features | 主要功能:
- Carries
GraphErrorCodefor programmatic error handling - 携带GraphErrorCode用于程序化错误处理 - Base class for all graph exceptions - 所有图异常的基类
- Extends
OpenExceptionfor unified exception hierarchy - 继承OpenException统一异常体系
Usage Examples | 使用示例:
try {
OpenGraph.topologicalSort(graph);
} catch (GraphException e) {
GraphErrorCode code = e.getGraphErrorCode();
}
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-graph V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGraphException(String message, GraphErrorCode errorCode) Create graph exception 创建图异常GraphException(String message, Throwable cause, GraphErrorCode errorCode) Create graph exception with cause 创建带原因的图异常 -
Method Summary
Modifier and TypeMethodDescriptionGet the graph error code 获取图错误码Methods 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
-
GraphException
Create graph exception 创建图异常- Parameters:
message- the error message | 错误消息errorCode- the error code | 错误码
-
GraphException
Create graph exception with cause 创建带原因的图异常- Parameters:
message- the error message | 错误消息cause- the cause | 原因errorCode- the error code | 错误码
-
-
Method Details
-
getGraphErrorCode
Get the graph error code 获取图错误码- Returns:
- graph error code | 图错误码
-