com.sap.cloud.rest.api.client.exceptions.ResponseException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-api-client Show documentation
Show all versions of rest-api-client Show documentation
Java HTTP client library for HTTP handling, when building clients for RESTful APIs.
The newest version!
package com.sap.cloud.rest.api.client.exceptions;
import com.sap.cloud.rest.api.client.model.HttpExchangeContext;
import com.sap.cloud.rest.api.client.model.Request;
import com.sap.cloud.rest.api.client.model.Response;
/**
* This exception represents that an error response code has been received from
* the remote service.
*
* It contains the context of the HTTP exchange.
*/
public class ResponseException extends RestApiClientException {
private static final long serialVersionUID = 1L;
private final HttpExchangeContext context;
public ResponseException(String message, HttpExchangeContext context) {
super(message);
this.context = context;
}
public ResponseException(String message, HttpExchangeContext context, Throwable cause) {
super(message, cause);
this.context = context;
}
public Request getRequest() {
return context.getRequest();
}
public Response getResponse() {
return context.getResponse();
}
}