Class SubscriptionPublisherException

All Implemented Interfaces:
Serializable

public final class SubscriptionPublisherException extends NestedRuntimeException
An exception raised after a GraphQL subscription Publisher ends with an exception, and after that exception has been resolved to GraphQL errors.

The underlying transport, e.g. WebSocket, can handle a SubscriptionPublisherException and send a final error message to the client with the list of GraphQL errors.

Since:
1.0.1
Author:
Mykyta Ivchenko, Rossen Stoyanchev
See Also:
  • Constructor Details

    • SubscriptionPublisherException

      public SubscriptionPublisherException(List<GraphQLError> errors, @Nullable Throwable cause)
      Constructor with the resolved GraphQL errors and the original exception from the GraphQL subscription Publisher.
      Parameters:
      errors - the list of resolved GraphQL errors
      cause - the original exception
  • Method Details

    • getErrors

      public List<GraphQLError> getErrors()
      Return the GraphQL errors the exception was resolved to by the configured SubscriptionExceptionResolver's. These errors can be included in an error message to be sent to the client by the underlying transport.
    • toMap

      public Map<String,Object> toMap()
      Return an ExecutionResult specification map with the GraphQL errors.
      Since:
      1.3.0