Package com.mongodb
Class MongoSocksProxyException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
com.mongodb.MongoSocketException
com.mongodb.MongoSocketOpenException
com.mongodb.MongoSocksProxyException
- All Implemented Interfaces:
Serializable
Thrown when an error occurs while connecting via a SOCKS5 proxy.
getProxyReplyCode() returns the RFC 1928 reply code sent by the proxy when a
non-success CONNECT reply was successfully parsed; it returns null otherwise
(including for any failure that did not produce a parsed CONNECT reply, e.g. proxy TCP
connect failure, negotiation failure, authentication failure, failure connecting through
the proxy to the target server that did not yield a parsed reply, or an I/O error
mid-CONNECT).
RFC 1928 reply codes: 1=general failure, 2=connection not allowed by ruleset, 3=network unreachable, 4=host unreachable, 5=connection refused, 6=TTL expired, 7=command not supported, 8=address type not supported.
- Since:
- 5.12
-
Field Summary
Fields inherited from class com.mongodb.MongoException
RETRYABLE_ERROR_LABEL, SYSTEM_OVERLOADED_ERROR_LABEL, TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL -
Constructor Summary
ConstructorsConstructorDescriptionMongoSocksProxyException(String message, ServerAddress serverAddress) Construct an instance with no cause and no RFC 1928 reply code.MongoSocksProxyException(String message, ServerAddress serverAddress, Integer proxyReplyCode) Construct an instance with no cause and an RFC 1928 reply code from a parsed non-success CONNECT reply.MongoSocksProxyException(String message, ServerAddress serverAddress, Throwable cause) Construct an instance with a cause and no RFC 1928 reply code.MongoSocksProxyException(String message, ServerAddress serverAddress, Throwable cause, Integer proxyReplyCode) Construct an instance with a cause and an optional RFC 1928 reply code. -
Method Summary
Modifier and TypeMethodDescriptionReturns the RFC 1928 reply code sent by the SOCKS5 proxy when a non-success CONNECT reply was successfully parsed, ornullotherwise.Methods inherited from class com.mongodb.MongoSocketException
getServerAddressMethods inherited from class com.mongodb.MongoException
addLabel, addLabels, addLabels, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabelMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MongoSocksProxyException
Construct an instance with no cause and no RFC 1928 reply code.- Parameters:
message- the messageserverAddress- the server address
-
MongoSocksProxyException
Construct an instance with a cause and no RFC 1928 reply code.- Parameters:
message- the messageserverAddress- the server addresscause- the cause
-
MongoSocksProxyException
public MongoSocksProxyException(String message, ServerAddress serverAddress, @Nullable Integer proxyReplyCode) Construct an instance with no cause and an RFC 1928 reply code from a parsed non-success CONNECT reply.- Parameters:
message- the messageserverAddress- the server addressproxyReplyCode- the RFC 1928 reply code, ornull
-
MongoSocksProxyException
public MongoSocksProxyException(String message, ServerAddress serverAddress, @Nullable Throwable cause, @Nullable Integer proxyReplyCode) Construct an instance with a cause and an optional RFC 1928 reply code.- Parameters:
message- the messageserverAddress- the server addresscause- the cause, may benullproxyReplyCode- the RFC 1928 reply code, ornull
-
-
Method Details
-
getProxyReplyCode
Returns the RFC 1928 reply code sent by the SOCKS5 proxy when a non-success CONNECT reply was successfully parsed, ornullotherwise.- Returns:
- the RFC 1928 proxy reply code, or
null
-