Package com.tnsai.exceptions
Class NetworkException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.exceptions.NetworkException
- All Implemented Interfaces:
Serializable
Exception for network-related errors (connection failures, DNS issues, etc.).
Always retryable with exponential backoff recommended.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkException(String message) NetworkException(String message, Throwable cause) NetworkException(String message, Throwable cause, String host, Integer port) -
Method Summary
Modifier and TypeMethodDescriptionstatic NetworkExceptionconnectionRefused(String host, int port) Factory method for connection refused errors.static NetworkExceptionconnectionTimeout(String host, int port, long timeoutMs) Factory method for connection timeout.static NetworkExceptiondnsResolutionFailed(String host, Throwable cause) Factory method for DNS resolution failures.getHost()intGets maximum recommended retry attempts.getPort()longGets suggested retry delay in milliseconds.Methods inherited from class com.tnsai.exceptions.TnsAIException
getContext, getErrorCode, getMessage, getThrownAt, isRetryable, wrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NetworkException
-
NetworkException
-
NetworkException
-
-
Method Details
-
getHost
-
getPort
-
getSuggestedRetryDelayMs
public long getSuggestedRetryDelayMs()Description copied from class:TnsAIExceptionGets suggested retry delay in milliseconds. Override in subclasses for specific retry strategies.- Overrides:
getSuggestedRetryDelayMsin classTnsAIException
-
getMaxRetryAttempts
public int getMaxRetryAttempts()Description copied from class:TnsAIExceptionGets maximum recommended retry attempts.- Overrides:
getMaxRetryAttemptsin classTnsAIException
-
connectionRefused
Factory method for connection refused errors. -
dnsResolutionFailed
Factory method for DNS resolution failures. -
connectionTimeout
Factory method for connection timeout.
-