Package com.tnsai.communication
Class CommunicationViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.communication.CommunicationViolationException
- All Implemented Interfaces:
Serializable
Exception thrown when a communication policy is violated.
This exception is thrown when:
- Response is in a non-allowed language
- Response exceeds maximum length
- Response format doesn't match expected format
- Author:
- TnsAI Team
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of communication violations. -
Constructor Summary
ConstructorsConstructorDescriptionCommunicationViolationException(String message, CommunicationViolationException.ViolationType violationType) Creates a communication violation exception.CommunicationViolationException(String message, Throwable cause, CommunicationViolationException.ViolationType violationType) Creates a communication violation exception with a cause. -
Method Summary
Modifier and TypeMethodDescriptionGets the type of communication violation.Methods inherited from class com.tnsai.exceptions.TnsAIException
getContext, getErrorCode, getMaxRetryAttempts, getMessage, getSuggestedRetryDelayMs, getThrownAt, isRetryable, wrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CommunicationViolationException
public CommunicationViolationException(String message, CommunicationViolationException.ViolationType violationType) Creates a communication violation exception.- Parameters:
message- the error messageviolationType- the type of violation
-
CommunicationViolationException
public CommunicationViolationException(String message, Throwable cause, CommunicationViolationException.ViolationType violationType) Creates a communication violation exception with a cause.- Parameters:
message- the error messagecause- the underlying causeviolationType- the type of violation
-
-
Method Details
-
getViolationType
Gets the type of communication violation.- Returns:
- violation type
-