Package graphql
Class ExceptionWhileDataFetching
- java.lang.Object
-
- graphql.ExceptionWhileDataFetching
-
- All Implemented Interfaces:
GraphQLError,java.io.Serializable
@PublicApi public class ExceptionWhileDataFetching extends java.lang.Object implements GraphQLError
This graphql error will be used if a runtime exception is encountered while a data fetcher is invoked- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface graphql.GraphQLError
GraphQLError.Builder<B extends GraphQLError.Builder<B>>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwableexceptionprivate java.util.Map<java.lang.String,java.lang.Object>extensionsprivate java.util.List<SourceLocation>locationsprivate java.lang.Stringmessageprivate java.util.List<java.lang.Object>path
-
Constructor Summary
Constructors Constructor Description ExceptionWhileDataFetching(ResultPath path, java.lang.Throwable exception, SourceLocation sourceLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)ErrorTypegetErrorType()java.lang.ThrowablegetException()java.util.Map<java.lang.String,java.lang.Object>getExtensions()java.util.List<SourceLocation>getLocations()java.lang.StringgetMessage()java.util.List<java.lang.Object>getPath()The graphql spec says that the (optional) path field of any error should be a list of path entries https://spec.graphql.org/October2021/#sec-Handling-Field-ErrorsinthashCode()private java.util.Map<java.lang.String,java.lang.Object>mkExtensions(java.lang.Throwable exception)private java.lang.StringmkMessage(ResultPath path, java.lang.Throwable exception)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface graphql.GraphQLError
toSpecification
-
-
-
-
Field Detail
-
message
private final java.lang.String message
-
path
private final java.util.List<java.lang.Object> path
-
exception
private final java.lang.Throwable exception
-
locations
private final java.util.List<SourceLocation> locations
-
extensions
private final java.util.Map<java.lang.String,java.lang.Object> extensions
-
-
Constructor Detail
-
ExceptionWhileDataFetching
public ExceptionWhileDataFetching(ResultPath path, java.lang.Throwable exception, SourceLocation sourceLocation)
-
-
Method Detail
-
mkMessage
private java.lang.String mkMessage(ResultPath path, java.lang.Throwable exception)
-
mkExtensions
private java.util.Map<java.lang.String,java.lang.Object> mkExtensions(java.lang.Throwable exception)
-
getException
public java.lang.Throwable getException()
-
getMessage
public java.lang.String getMessage()
- Specified by:
getMessagein interfaceGraphQLError- Returns:
- a description of the error intended for the developer as a guide to understand and correct the error
-
getLocations
public java.util.List<SourceLocation> getLocations()
- Specified by:
getLocationsin interfaceGraphQLError- Returns:
- the location(s) within the GraphQL document at which the error occurred. Each
SourceLocationdescribes the beginning of an associated syntax element
-
getPath
public java.util.List<java.lang.Object> getPath()
Description copied from interface:GraphQLErrorThe graphql spec says that the (optional) path field of any error should be a list of path entries https://spec.graphql.org/October2021/#sec-Handling-Field-Errors- Specified by:
getPathin interfaceGraphQLError- Returns:
- the path in list format
-
getExtensions
public java.util.Map<java.lang.String,java.lang.Object> getExtensions()
- Specified by:
getExtensionsin interfaceGraphQLError- Returns:
- a map of error extensions or null if there are none
-
getErrorType
public ErrorType getErrorType()
- Specified by:
getErrorTypein interfaceGraphQLError- Returns:
- an object classifying this error
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-