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 com.fasterxml.jackson.core.JsonProcessingException;

import javax.ws.rs.core.MultivaluedMap;

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy