All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.rest.api.client.exceptions.ResponseException Maven / Gradle / Ivy

Go to download

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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy