Class NoHandlerForCommandException

All Implemented Interfaces:
Serializable

public class NoHandlerForCommandException extends AxonTransientException
Exception indicating that no suitable command handler could be found for the given command.

As of 4.2, this exception has been moved to AxonTransientException, since (especially in a MicroServices Architecture context) the handler may return. RetrySchedulers will now see this exception as retryable.

Since:
0.5
Author:
Allard Buijze
See Also:
  • Constructor Details

    • NoHandlerForCommandException

      public NoHandlerForCommandException(String message)
      Initialize this exception with the given message.
      Parameters:
      message - The message describing the cause of the exception.
    • NoHandlerForCommandException

      public NoHandlerForCommandException(CommandMessage commandMessage)
      Initialize this exception with a message describing the given CommandMessage. This constructor specifies in its message that missing parameters could be the culprit of finding a matching handler.
      Parameters:
      commandMessage - The command for which no handler was found.
    • NoHandlerForCommandException

      public NoHandlerForCommandException(@Nonnull CommandMessage message, @Nonnull Class<?> entityType)
      Initialize this exception with a message describing the given CommandMessage and the given entityType.
      Parameters:
      message - The CommandMessage that was handled.
      entityType - The Class of the entity that was expected to handle the command.