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

com.smartbear.readyapi.client.execution.ApiException Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

There is a newer version: 1.2.1
Show newest version
package com.smartbear.readyapi.client.execution;

import javax.ws.rs.core.MultivaluedMap;

public class ApiException extends RuntimeException {
    private int statusCode;
    private String responseBody;
    private MultivaluedMap headers;

    public ApiException(int statusCode, String responseBody, MultivaluedMap headers) {
        super(responseBody);
        this.statusCode = statusCode;
        this.responseBody = responseBody;
        this.headers = headers;
    }

    public ApiException(int statusCode, String message) {
        super(message);
        this.statusCode = statusCode;
    }

    public ApiException(Exception e) {
        super(e);
    }

    @Override
    public String toString() {
        return new StringBuilder(getClass().getName())
                .append("{")
                .append("code=").append(statusCode)
                .append(", message=").append(getMessage() != null ? getMessage() : responseBody)
                .append(", responseHeaders=").append(headers)
                .append(", responseBody='").append(responseBody).append("\'")
                .append("}").toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy