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

org.rapidgraphql.client.exceptions.GraphQLErrorException Maven / Gradle / Ivy

package org.rapidgraphql.client.exceptions;

import kong.unirest.core.json.JSONObject;
import lombok.Getter;

import java.util.List;

public class GraphQLErrorException extends RapidGraphQLClientException {
    @Getter
    private final List errors;
    public GraphQLErrorException(List errors) {
        super(extractMessage(errors));
        this.errors = errors;
    }

    private static String extractMessage(List errors) {
        if (errors==null || errors.isEmpty()) {
            return "No 'errors' object provided in graphql response";
        }
        return errors.get(0).getMessage();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy