Class GraphException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.graph.exception.GraphException
- All Implemented Interfaces:
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 - 所有图异常的基类
Usage Examples | 使用示例:
try {
OpenGraph.topologicalSort(graph);
} catch (GraphException e) {
GraphErrorCode code = e.getErrorCode();
}
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-graph V1.0.0
- 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
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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
-
getErrorCode
-