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

io.permit.sdk.api.PermitApiError Maven / Gradle / Ivy

There is a newer version: 983f46e
Show newest version
package io.permit.sdk.api;

import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;

public class PermitApiError extends Exception {
    final private int responseCode;
    final private String rawResponse;

    public PermitApiError(String s, int responseCode, String responseString) {
        super(s);
        this.responseCode = responseCode;
        this.rawResponse = responseString;
    }

    public int getResponseCode() { return responseCode; }

    public String getRawResponse() { return rawResponse; }

    public LinkedTreeMap getErrorObject () {
        return (new Gson()).fromJson(rawResponse, LinkedTreeMap.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy