Class NoSuchHeaderOrPropertyException

All Implemented Interfaces:
Serializable

public class NoSuchHeaderOrPropertyException extends CamelExchangeException
Thrown when neither a mandatory header nor a mandatory exchange property is available on an Exchange, and at least one of them is required for processing to continue.

Combines the roles of NoSuchHeaderException and NoSuchPropertyException for callers that accept either source but need at least one to be present.

Since:
3.18
See Also:
  • Constructor Details

    • NoSuchHeaderOrPropertyException

      public NoSuchHeaderOrPropertyException(Exchange exchange, String headerName, String propertyName, Class<?> type)
      Parameters:
      exchange - the exchange that caused the error
      headerName - the name of the header that could not be found
      propertyName - the name of the property that could not be found
      type - the expected type of the header or property
  • Method Details

    • getHeaderName

      public String getHeaderName()
    • getPropertyName

      public String getPropertyName()
    • getType

      public Class<?> getType()
    • header

      protected static String header(Exchange exchange, String headerName)
    • property

      protected static String property(Exchange exchange, String propertyName)