public class HttpErrorPage extends Exception
This exception can include a HTTP response (with error page body) or a String body.
Constructor and Description |
---|
HttpErrorPage(org.apache.http.client.methods.CloseableHttpResponse httpResponse)
Create an HTTP error page exception from an Http response.
|
HttpErrorPage(int statusCode,
String statusMessage,
Exception exception)
Create an HTTP response from an exception.
|
HttpErrorPage(int statusCode,
String statusMessage,
String content)
Create an HTTP response from a String content wich will be used as the response entity.
|
Modifier and Type | Method and Description |
---|---|
static org.apache.http.client.methods.CloseableHttpResponse |
generateHttpResponse(Exception exception) |
static org.apache.http.client.methods.CloseableHttpResponse |
generateHttpResponse(int statusCode,
String statusText) |
org.apache.http.client.methods.CloseableHttpResponse |
getHttpResponse()
Get HTTP response enclosed in this exception.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public HttpErrorPage(org.apache.http.client.methods.CloseableHttpResponse httpResponse)
httpResponse
- backend response.public HttpErrorPage(int statusCode, String statusMessage, String content)
statusCode
- statusMessage
- content
- public org.apache.http.client.methods.CloseableHttpResponse getHttpResponse()
public static org.apache.http.client.methods.CloseableHttpResponse generateHttpResponse(Exception exception)
public static org.apache.http.client.methods.CloseableHttpResponse generateHttpResponse(int statusCode, String statusText)
Copyright © 2008–2018. All rights reserved.