Package ro.sync.exml.plugin.ai
Class ExternalServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ro.sync.exml.plugin.ai.ExternalServiceException
- All Implemented Interfaces:
Serializable
Exception thrown when an error occurs while interacting with an external service.
This exception is typically used when an error arises during the execution of a tool (external AI function), such as failures in making external API calls, issues in processing data, or errors in service communication.
This class includes an isFatal flag to indicate whether the error is severe enough to stop further AI interactions or other functions executions.
- Since:
- 27
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExternalServiceException(String message, boolean isFatal) Constructs a new ExternalServiceException with the specified detail message and fatal flag.ExternalServiceException(String message, Throwable cause, boolean isFatal) Constructs a new ExternalServiceException with the specified detail message, cause, and fatal flag. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisFatal()Returns whether the exception is considered fatal.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ExternalServiceException
Constructs a new ExternalServiceException with the specified detail message and fatal flag.- Parameters:
message- the detail message explaining the cause of the exception.isFatal- a flag indicating if the exception is fatal and should stop further execution.
-
ExternalServiceException
Constructs a new ExternalServiceException with the specified detail message, cause, and fatal flag.- Parameters:
message- the detail message explaining the cause of the exception.cause- the cause of the exception (aThrowableobject).isFatal- a flag indicating if the exception is fatal and should stop further execution.
-
-
Method Details
-
isFatal
public boolean isFatal()Returns whether the exception is considered fatal.If
true, it indicates that the error is critical and further interaction with the AI or further tool executions should be halted. Iffalse, it means the error is non-fatal and the system can recover or continue executing other tasks.- Returns:
trueif the exception is fatal;falseotherwise.
-