Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1965] Filter out the null elements from the list of errors in Graph… #1967

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.smallrye.graphql.client;

import static java.util.Collections.singletonList;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.joining;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Represents a response that contained application-level errors and thus can't be turned into a domain object.
Expand All @@ -17,12 +19,12 @@ public class GraphQLClientException extends RuntimeException {

public GraphQLClientException(String message, GraphQLError error) {
super(message);
this.errors = Collections.singletonList(requireNonNull(error));
this.errors = singletonList(requireNonNull(error));
}

public GraphQLClientException(String message, List<GraphQLError> errors) {
super(message);
this.errors = requireNonNull(errors);
this.errors = requireNonNull(errors).stream().map(Objects::requireNonNull).collect(Collectors.toList());
}

@Override
Expand Down
Loading