Class NoSuchHeaderException

All Implemented Interfaces:
Serializable

public class NoSuchHeaderException extends CamelExchangeException
Thrown when a mandatory header is not available on the Message of an Exchange.

Typically raised by

invalid reference
org.apache.camel.support.ExchangeHelper#getMandatoryHeader(Exchange, String, Class)
when a processor requires a specific header to be present.
See Also:
  • Constructor Details

    • NoSuchHeaderException

      public NoSuchHeaderException(String message, Exchange exchange, String headerName)
      Parameters:
      message - the detail message
      exchange - the exchange that caused the error
      headerName - the name of the missing header
    • NoSuchHeaderException

      public NoSuchHeaderException(Exchange exchange, String headerName, @Nullable Class<?> type)
      Parameters:
      exchange - the exchange that caused the error
      headerName - the name of the missing header
      type - the expected header type, or null if no specific type is required
  • Method Details

    • getHeaderName

      public String getHeaderName()
    • getType

      public @Nullable Class<?> getType()
    • reason

      protected static String reason(Exchange exchange, String headerName)