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

io.magentys.rest.RestResponseException Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package io.magentys.rest;

import io.magentys.rest.model.RestResponse;

public class RestResponseException extends RuntimeException {

    public RestResponseException(String message) {
        super(message);
    }

    public static  void throwOnResponseFailure(final RestResponse response) {
        if (response.failed()) {
            throw new RestResponseException(String.format("Unexpected response status: %s, body: %s", response.statusCode(), response.body()));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy