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

com.gettyimages.api.HttpSystemErrorException Maven / Gradle / Ivy

There is a newer version: 3.1.9
Show newest version
package com.gettyimages.api;

import org.apache.http.StatusLine;

public class HttpSystemErrorException extends SdkException {

    private final int statusCode;
    private final String reasonPhrase;

    public HttpSystemErrorException(final StatusLine statusLine) {
        super("System Error (" + statusLine.getStatusCode() + "): " + statusLine.getReasonPhrase());
        this.statusCode = statusLine.getStatusCode();
        this.reasonPhrase = statusLine.getReasonPhrase();
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getReasonPhrase() {
        return reasonPhrase;
    }

    public HttpSystemErrorException(final Exception e) {
        super("System Error (500): Unexpected Error");
        this.statusCode = 500;
        this.reasonPhrase = "UnexpectedError"; // TODO: de-dupe
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy