org.apache.hc.core5.http

## Class ProtocolException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.apache.hc.core5.http.HttpException
      - - org.apache.hc.core5.http.ProtocolException

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    LengthRequiredException, MethodNotSupportedException, MisdirectedRequestException, NotImplementedException, ParseException, RequestHeaderFieldsTooLargeException, UnsupportedHttpVersionException

      public class ProtocolException
      extends HttpException

  Signals that an HTTP protocol violation has occurred. For example a malformed status line or headers, a missing message body, etc.
  Since:
    4.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtocolException()` Creates a new ProtocolException with a `null` detail message.
    `ProtocolException(String message)` Creates a new ProtocolException with the specified detail message.
    `ProtocolException(String format, Object... args)` Constructs a new ProtocolException with the specified detail message.
    `ProtocolException(String message, Throwable cause)` Creates a new ProtocolException with the specified detail message and cause.

  - ### Method Summary

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ProtocolException

          public ProtocolException()

      Creates a new ProtocolException with a `null` detail message.

    - #### ProtocolException

          public ProtocolException(String message)

      Creates a new ProtocolException with the specified detail message.
      Parameters:
        `message` - The exception detail message

    - #### ProtocolException

          public ProtocolException(String format,
                           Object... args)

      Constructs a new ProtocolException with the specified detail message.
      Parameters:
        `format` - The exception detail message format; see `String.format(String, Object...)`.
        `args` - The exception detail message arguments; see `String.format(String, Object...)`.
      Since:
        5.0

    - #### ProtocolException

          public ProtocolException(String message,
                           Throwable cause)

      Creates a new ProtocolException with the specified detail message and cause.
      Parameters:
        `message` - the exception detail message
        `cause` - the `Throwable` that caused this exception, or `null` if the cause is unavailable, unknown, or not a `Throwable`

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.