Enum Class ProxyFailure.ConnectFailed.Reason

java.lang.Object
java.lang.Enum<ProxyFailure.ConnectFailed.Reason>
org.microproxy.ProxyFailure.ConnectFailed.Reason
All Implemented Interfaces:
Serializable, Comparable<ProxyFailure.ConnectFailed.Reason>, Constable
Enclosing class:
ProxyFailure.ConnectFailed

public static enum ProxyFailure.ConnectFailed.Reason extends Enum<ProxyFailure.ConnectFailed.Reason>
How a connection attempt failed, read from the exception's cause chain: what a chained HTTP proxy did with the proxy's CONNECT (ChainedProxyConnectException), or anything else. code() is the reason's snake_case name.
  • Enum Constant Details

  • Method Details

    • values

      public static ProxyFailure.ConnectFailed.Reason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProxyFailure.ConnectFailed.Reason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public String code()
      Returns the reason's name in lower case: chained_proxy_refused, ....
      Returns:
      the reason's name in lower case: chained_proxy_refused, ...
    • of

      public static ProxyFailure.ConnectFailed.Reason of(Throwable failure)
      Classifies a failed connection attempt by its exception's cause chain.
      Parameters:
      failure - the attempt's exception, or null
      Returns:
      the reason, OTHER when none is recognized