Class RequestException

  • All Implemented Interfaces:
    java.io.Serializable

    public class RequestException
    extends java.io.IOException
    Exception class for HTTP request errors.
    Author:
    Christopher Mindus
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      intrc
      The HTTP return code, -1 if no code can be discerned from the response (i.e., the response is not valid HTTP).
      java.lang.Stringreply
      The HTTP reply.
    • Constructor Summary

      Constructors 
      ConstructorDescription
      RequestException​(java.lang.String message)
      Creates a request exception.
      RequestException​(java.lang.String message, java.lang.Throwable cause)
      Creates a request exception.
      RequestException​(java.lang.String message, java.lang.Throwable cause, int rc, java.lang.String reply)
      Creates a request exception.
    • 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
    • Field Detail

      • rc

        public final int rc
        The HTTP return code, -1 if no code can be discerned from the response (i.e., the response is not valid HTTP).
      • reply

        public final java.lang.String reply
        The HTTP reply. Extracts the Strings "OK" and "Not Found" respectively from the HTTP reply (e.g. "HTTP/1.0 404 Not Found"), null if none could be discerned from the responses (the result was not valid HTTP).
    • Constructor Detail

      • RequestException

        public RequestException​(java.lang.String message)
        Creates a request exception.
        Parameters:
        message - The message.
      • RequestException

        public RequestException​(java.lang.String message,
                                java.lang.Throwable cause)
        Creates a request exception.
        Parameters:
        message - The message.
        cause - The cause.
      • RequestException

        public RequestException​(java.lang.String message,
                                java.lang.Throwable cause,
                                int rc,
                                java.lang.String reply)
        Creates a request exception.
        Parameters:
        message - The message.
        cause - The cause.
        rc - The HTTP return code.
        reply - The reply from HTTP.