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

graphql.schema.validation.InvalidSchemaException Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.schema.validation;

import graphql.GraphQLException;
import graphql.Internal;
import graphql.VisibleForTesting;

import java.util.Collection;

@Internal
public class InvalidSchemaException extends GraphQLException {

    private final Collection errors;

    public InvalidSchemaException(Collection errors) {
        super(buildErrorMsg(errors));
        this.errors = errors;
    }

    @VisibleForTesting
    Collection getErrors() {
        return errors;
    }

    private static String buildErrorMsg(Collection errors) {
        StringBuilder message = new StringBuilder("invalid schema:");
        for (SchemaValidationError error : errors) {
            message.append("\n").append(error.getDescription());
        }
        return message.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy