Class ExternalServiceException
- All Implemented Interfaces:
Serializable
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
**************************************
EXPERIMENTAL - Subject to change
**************************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
- 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 TypeMethodDescriptionboolean
isFatal()
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 (aThrowable
object).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:
true
if the exception is fatal;false
otherwise.
-