Class Error

  • All Implemented Interfaces:
    graphql.GraphQLError, java.io.Serializable

    public class Error
    extends java.lang.Object
    implements graphql.GraphQLError
    The error POJO, mapped from the GraphQL server response, when an error occurs
    Author:
    etienne-sf
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface graphql.GraphQLError

        graphql.GraphQLError.Builder<B extends graphql.GraphQLError.Builder<B>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String description  
      java.lang.String errorType  
      com.fasterxml.jackson.databind.JsonNode extensions
      The extensions field of errors, stored as is from the incoming GraphQL response.
      java.util.List<Location> locations  
      java.lang.String message  
      java.util.List<java.lang.String> path  
      java.util.List<java.lang.String> queryPath  
      java.lang.String validationErrorType  
    • Constructor Summary

      Constructors 
      Constructor Description
      Error()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      graphql.ErrorClassification getErrorType()  
      java.util.Map<java.lang.String,​java.lang.Object> getExtensions()  
      com.fasterxml.jackson.databind.JsonNode getExtensionsAsJsonNode()  
      java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMapOfJsonNode()
      Returns the extensions as a map.
      java.util.Map<java.lang.String,​java.lang.String> getExtensionsAsMapStringString()
      Returns the extensions as a map.
      <T> T getExtensionsField​(java.lang.String key, java.lang.Class<T> t)
      Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.
      java.util.List<graphql.language.SourceLocation> getLocations()  
      java.lang.String getMessage()  
      void setExtensions​(com.fasterxml.jackson.databind.JsonNode extensions)  
      java.lang.String toString()
      Logs this error to the given Logger
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface graphql.GraphQLError

        getPath, toSpecification
    • Field Detail

      • message

        public java.lang.String message
      • locations

        public java.util.List<Location> locations
      • description

        public java.lang.String description
      • validationErrorType

        public java.lang.String validationErrorType
      • queryPath

        public java.util.List<java.lang.String> queryPath
      • errorType

        public java.lang.String errorType
      • path

        public java.util.List<java.lang.String> path
    • Constructor Detail

      • Error

        public Error()
    • Method Detail

      • toString

        public java.lang.String toString()
        Logs this error to the given Logger
        Overrides:
        toString in class java.lang.Object
        Parameters:
        logger -
      • getExtensionsAsJsonNode

        public com.fasterxml.jackson.databind.JsonNode getExtensionsAsJsonNode()
      • setExtensions

        public void setExtensions​(com.fasterxml.jackson.databind.JsonNode extensions)
      • getExtensions

        public java.util.Map<java.lang.String,​java.lang.Object> getExtensions()
        Specified by:
        getExtensions in interface graphql.GraphQLError
      • getExtensionsAsMapOfJsonNode

        public java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> getExtensionsAsMapOfJsonNode()
        Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
        Returns:
      • getExtensionsAsMapStringString

        public java.util.Map<java.lang.String,​java.lang.String> getExtensionsAsMapStringString()
        Returns the extensions as a map. The values can't be deserialized, as their type is unknown.
        Returns:
      • getExtensionsField

        public <T> T getExtensionsField​(java.lang.String key,
                                        java.lang.Class<T> t)
                                 throws com.fasterxml.jackson.core.JsonProcessingException
        Parse the value for the given _key_, as found in the extensions field of the GraphQL server's response, into the given _t_ class.
        Type Parameters:
        T -
        Parameters:
        key -
        t -
        Returns:
        null if the key is not in the extensions map. Otherwise: the value for this _key_, as a _t_ instance
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - When there is an error when converting the key's value into the _t_ class
      • getMessage

        public java.lang.String getMessage()
        Specified by:
        getMessage in interface graphql.GraphQLError
      • getLocations

        public java.util.List<graphql.language.SourceLocation> getLocations()
        Specified by:
        getLocations in interface graphql.GraphQLError
      • getErrorType

        public graphql.ErrorClassification getErrorType()
        Specified by:
        getErrorType in interface graphql.GraphQLError