public class HttpException extends IOException
Constructor and Description |
---|
HttpException()
Creates a new HttpException with a null detail message.
|
HttpException(String message)
Creates a new HttpException with the specified detail message.
|
HttpException(String message,
Throwable cause)
Creates a new HttpException with the specified detail message and cause.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Return the Throwable that caused this exception, or null
if the cause is unavailable, unknown, or not a Throwable.
|
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(PrintStream s)
Print this HttpException and its stack trace to the specified print stream.
|
void |
printStackTrace(PrintWriter s)
Print this HttpException and its stack trace to the specified print writer.
|
void |
setReason(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.
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
public HttpException()
public HttpException(String message)
message
- the exception detail messagepublic HttpException(String message, Throwable cause)
message
- the exception detail messagecause
- the Throwable that caused this exception, or null
if the cause is unavailable, unknown, or not a Throwablepublic Throwable getCause()
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintStream s)
printStackTrace
in class Throwable
s
- the PrintStream to which the exception and its stack trace
should be writtenpublic void printStackTrace(PrintWriter s)
printStackTrace
in class Throwable
s
- the PrintWriter to which the exception and its stack trace
should be writtenpublic void setReason(String reason)
reason
- The reason for the exception.public String getReason()
public void setReasonCode(int code)
code
- The reason for the exception. This is intended to be an
HTTP status code.public int getReasonCode()
Copyright © 2019. All Rights Reserved.