HttpException (HttpClient Library (Version 3.1))
Date: 2016-03-09

org.apache.commons.httpclient

## Class HttpException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.io.IOException
      - - org.apache.commons.httpclient.HttpException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    HttpContentTooLargeException, HttpRecoverableException, ProtocolException, URIException

      public class HttpException
      extends java.io.IOException

  Signals that an HTTP or HttpClient exception has occurred.
  Version:
    $Revision: 480424 $ $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $
  Author:
    Laura Werner
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpException()` Creates a new HttpException with a `null` detail message.
    `HttpException(java.lang.String message)` Creates a new HttpException with the specified detail message.
    `HttpException(java.lang.String message, java.lang.Throwable cause)` Creates a new HttpException with the specified detail message and cause.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Throwable` | `getCause()` Return the `Throwable` that caused this exception, or `null` if the cause is unavailable, unknown, or not a `Throwable`.
    `java.lang.String` | `getReason()` Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
    `int` | `getReasonCode()` Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
    `void` | `printStackTrace()` Print this HttpException and its stack trace to the standard error stream.
    `void` | `printStackTrace(java.io.PrintStream s)` Print this HttpException and its stack trace to the specified print stream.
    `void` | `printStackTrace(java.io.PrintWriter s)` Print this HttpException and its stack trace to the specified print writer.
    `void` | `setReason(java.lang.String reason)` Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
    `void` | `setReasonCode(int code)` Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.

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

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

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

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

- - ### Constructor Detail

    - #### HttpException

          public HttpException()

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

    - #### HttpException

          public HttpException(java.lang.String message)

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

    - #### HttpException

          public HttpException(java.lang.String message,
                       java.lang.Throwable cause)

      Creates a new HttpException 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`
      Since:
        3.0

  - ### Method Detail

    - #### getCause

          public java.lang.Throwable getCause()

      Return the `Throwable` that caused this exception, or `null` if the cause is unavailable, unknown, or not a `Throwable`.
      Overrides:
        `getCause` in class `java.lang.Throwable`
      Returns:
        the `Throwable` that caused this exception, or `null` if the cause is unavailable, unknown, or not a `Throwable`
      Since:
        3.0

    - #### printStackTrace

          public void printStackTrace()

      Print this HttpException and its stack trace to the standard error stream.
      Overrides:
        `printStackTrace` in class `java.lang.Throwable`
      Since:
        3.0

    - #### printStackTrace

          public void printStackTrace(java.io.PrintStream s)

      Print this HttpException and its stack trace to the specified print stream.
      Overrides:
        `printStackTrace` in class `java.lang.Throwable`
      Parameters:
        `s` - the `PrintStream` to which the exception and its stack trace should be written
      Since:
        3.0

    - #### printStackTrace

          public void printStackTrace(java.io.PrintWriter s)

      Print this HttpException and its stack trace to the specified print writer.
      Overrides:
        `printStackTrace` in class `java.lang.Throwable`
      Parameters:
        `s` - the `PrintWriter` to which the exception and its stack trace should be written
      Since:
        3.0

    - #### setReason

          public void setReason(java.lang.String reason)

      Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
      Sets the text description of the reason for an exception.
      Parameters:
        `reason` - The reason for the exception.

    - #### getReason

          public java.lang.String getReason()

      Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
      Get the text description of the reason for an exception.

    - #### setReasonCode

          public void setReasonCode(int code)

      Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
      Sets the status code description of the reason for an exception.
      Parameters:
        `code` - The reason for the exception. This is intended to be an HTTP status code.

    - #### getReasonCode

          public int getReasonCode()

      Deprecated. HttpClient no longer uses this for itself. It is only provided for compatibility with existing clients, and will be removed in a future release.
      Get the status code description of the reason for an exception.

Copyright (c) 1999-2005 - Apache Software Foundation