Class InvalidPayloadRuntimeException

All Implemented Interfaces:
Serializable

public class InvalidPayloadRuntimeException extends RuntimeExchangeException
Unchecked variant of InvalidPayloadException, thrown when the body of a Message cannot be converted to the expected type.

Used in contexts where a checked exception is not permitted, such as inside a Processor that calls Message.getMandatoryBody(Class).

See Also:
  • Constructor Details

    • InvalidPayloadRuntimeException

      public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type)
      Parameters:
      exchange - the exchange that caused the error
      type - the expected body type
    • InvalidPayloadRuntimeException

      public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type, Throwable cause)
      Parameters:
      exchange - the exchange that caused the error
      type - the expected body type
      cause - the cause of the failure
    • InvalidPayloadRuntimeException

      public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type, Message message)
      Parameters:
      exchange - the exchange that caused the error
      type - the expected body type
      message - the message with the invalid or missing payload
    • InvalidPayloadRuntimeException

      public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type, Message message, Throwable cause)
      Parameters:
      exchange - the exchange that caused the error
      type - the expected body type
      message - the message with the invalid or missing payload
      cause - the cause of the failure
  • Method Details

    • getType

      public @Nullable Class<?> getType()
      The expected type of the body