title: Unable to get rid of 'Exception while fetching data(/{apiName})' in graphql-spqr-spring-boot-starter
body: <p>I’m using ‘graphql-spqr-spring-boot-starter’ library version 0.0.4 of ‘io.leangen.graphql’. I'm able to customize errors. See the below code and screenshot for reference:</p>
  <p>Models:</p>
  <pre><code>@Getter
  @Setter
  @ToString
  @Entity
  @Accessors
  public class Student {
      
      @Id 
      @GraphQLQuery(name = &quot;id&quot;, description = &quot;A Student's ID&quot;)
      private Long id;
      
      @GraphQLQuery(name = &quot;name&quot;, description = &quot;A student's name&quot;)
      private String name;    
      
      private String addr;
  
  }
  </code></pre>
  <p>Service class:</p>
  <pre><code>@Service
  @GraphQLApi
  public class StudentService{
      
      private final StudentRepository studentRepository;
      private final AddressRepository addressRepository;
      
      public StudentService(StudentRepository studentRepository, AddressRepository addressRepository) {
          this.addressRepository = addressRepository;
          this.studentRepository = studentRepository;
      }
      
      @GraphQLQuery(name = &quot;allStudents&quot;)
      public List&lt;Student&gt; getAllStudents() {
          return studentRepository.findAll();
      }
  
      @GraphQLQuery(name = &quot;student&quot;)
      public Optional&lt;Student&gt; getStudentById(@GraphQLArgument(name = &quot;id&quot;) Long id) {
          if(studentRepository.findById(id) != null)
              return studentRepository.findById(id);
          throw new StudentNotFoundException(&quot;We were unable to find a student with the provided id&quot;, &quot;id&quot;);
      }
      
      @GraphQLMutation(name = &quot;saveStudent&quot;)
      public Student saveStudent(@GraphQLArgument(name = &quot;student&quot;) Student student) {
          if(student.getId() == null)
              throw new NoIdException(&quot;Please provide an Id to create a Student entry.&quot;);
          return studentRepository.save(student);
      }
  }
  </code></pre>
  <p>Customized Exception class:</p>
  <pre><code>import java.util.List;
  
  import graphql.ErrorType;
  import graphql.GraphQLError;
  import graphql.language.SourceLocation;
  
  public class NoIdException extends RuntimeException implements GraphQLError {
      
      private String noIdMsg;
      
      public NoIdException(String noIdMsg) {
          this.noIdMsg = noIdMsg;
      }
  
      @Override
      public List&lt;SourceLocation&gt; getLocations() {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public ErrorType getErrorType() {
          // TODO Auto-generated method stub
          return ErrorType.ValidationError;
      }
  
      @Override
      public String getMessage() {
          // TODO Auto-generated method stub
          return noIdMsg;
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ylRIW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ylRIW.png" alt="Image for post" /></a></p>
  <p>However, I’m not sure how to get rid of <code>Exception while fetching data (/saveStudent)</code> as seen on the above screenshot for the <code>message</code> field. I know we can have <code>GraphQLExceptionHandler</code> class which implements <code>GraphQLErrorHandler (graphql-java-kickstart)</code>. But what is the option for <code>sqpr-spring-boot-starter</code>?</p>
  <pre><code>import graphql.*;
  import graphql.kickstart.execution.error.*;
  import org.springframework.stereotype.*;
  
  import java.util.*;
  import java.util.stream.*;
  
  @Component
  public class GraphQLExceptionHandler implements GraphQLErrorHandler {
  
      @Override
      public List&lt;GraphQLError&gt; processErrors(List&lt;GraphQLError&gt; list) {
          return list.stream().map(this::getNested).collect(Collectors.toList());
      }
  
      private GraphQLError getNested(GraphQLError error) {
          if (error instanceof ExceptionWhileDataFetching) {
              ExceptionWhileDataFetching exceptionError = (ExceptionWhileDataFetching) error;
              if (exceptionError.getException() instanceof GraphQLError) {
                  return (GraphQLError) exceptionError.getException();
              }
          }
          return error;
      }
  }
  </code></pre>
  <p>Could someone please help me how can I remove this statement and send just the specific message?</p>