Package com.google.genkit.core
Class GenkitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.genkit.core.GenkitException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SessionContext.SessionException
GenkitException is the base exception for all Genkit errors. It provides
structured error information including error codes and details.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for GenkitException. -
Constructor Summary
ConstructorsConstructorDescriptionGenkitException(String message) Creates a new GenkitException.GenkitException(String message, Throwable cause) Creates a new GenkitException with a cause.Creates a new GenkitException with full details. -
Method Summary
Modifier and TypeMethodDescriptionstatic GenkitException.Builderbuilder()Creates a builder for GenkitException.Returns additional error details.Returns the error code.Returns the trace ID for this error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
GenkitException
Creates a new GenkitException.- Parameters:
message- the error message
-
GenkitException
Creates a new GenkitException with a cause.- Parameters:
message- the error messagecause- the underlying cause
-
GenkitException
public GenkitException(String message, Throwable cause, String errorCode, Object details, String traceId) Creates a new GenkitException with full details.- Parameters:
message- the error messagecause- the underlying causeerrorCode- the error codedetails- additional error detailstraceId- the trace ID for debugging
-
-
Method Details
-
getErrorCode
Returns the error code.- Returns:
- the error code, or null if not set
-
getDetails
Returns additional error details.- Returns:
- the error details, or null if not set
-
getTraceId
Returns the trace ID for this error.- Returns:
- the trace ID, or null if not set
-
builder
Creates a builder for GenkitException.- Returns:
- a new builder
-