Package graphql
Class GraphqlErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
graphql.GraphQLException
graphql.GraphqlErrorException
- All Implemented Interfaces:
GraphQLError
,Serializable
- Direct Known Subclasses:
CoercingParseLiteralException
,CoercingParseValueException
,CoercingSerializeException
A base class for graphql runtime exceptions that also implement
GraphQLError
and can be used
in a general sense direct or have specialisations made of it.
This is aimed amongst other reasons at Kotlin consumers due to https://github.com/graphql-java/graphql-java/issues/1690 as well as being a way to share common code.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
protected static class
GraphqlErrorException.BuilderBase<T extends GraphqlErrorException.BuilderBase<T,
B>, B extends GraphqlErrorException> A trait like base class that contains the properties that GraphqlErrorException handles and can be used by other classes to derive their own builders. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GraphqlErrorException
(GraphqlErrorException.BuilderBase<?, ?> builder) -
Method Summary
Modifier and TypeMethodDescriptiongetPath()
The graphql spec says that the (optional) path field of any error must be a list of path entries starting at the root of the response and ending with the field associated with the error https://spec.graphql.org/draft/#sec-Errors.Error-Result-FormatMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface graphql.GraphQLError
getMessage, toSpecification
-
Constructor Details
-
GraphqlErrorException
-
-
Method Details
-
getLocations
- Specified by:
getLocations
in interfaceGraphQLError
- Returns:
- the location(s) within the GraphQL document at which the error occurred. Each
SourceLocation
describes the beginning of an associated syntax element
-
getErrorType
- Specified by:
getErrorType
in interfaceGraphQLError
- Returns:
- an object classifying this error
-
getPath
Description copied from interface:GraphQLError
The graphql spec says that the (optional) path field of any error must be a list of path entries starting at the root of the response and ending with the field associated with the error https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format- Specified by:
getPath
in interfaceGraphQLError
- Returns:
- the path in list format
-
getExtensions
- Specified by:
getExtensions
in interfaceGraphQLError
- Returns:
- a map of error extensions or null if there are none
-
newErrorException
-