Class CamelExchangeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.camel.CamelException
org.apache.camel.CamelExchangeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CamelAuthorizationException, CamelUnitOfWorkException, ExchangeTimedOutException, InvalidPayloadException, NoSuchHeaderException, NoSuchHeaderOrPropertyException, NoSuchPropertyException, NoSuchVariableException, RollbackExchangeException, ValidationException
A
CamelException that carries the Exchange whose processing triggered the failure.
Used by Camel routing internals to attach exchange context to a failure so error handlers, the dead-letter channel
and onException clauses can inspect headers, properties and the in-flight Message. The reference is
transient because exchanges are not guaranteed to be serializable.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCamelExchangeException(@Nullable String message, @Nullable Exchange exchange) CamelExchangeException(@Nullable String message, @Nullable Exchange exchange, @Nullable Throwable cause) -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CamelExchangeException
-
CamelExchangeException
-
-
Method Details
-
getExchange
Returns the exchange which caused the exception -
createExceptionMessage
public static String createExceptionMessage(@Nullable String message, @Nullable Exchange exchange, @Nullable Throwable cause) Creates an exception message with the provided details. All fields is optional so you can pass in only an exception, or just a message etc. or any combination.- Parameters:
message- the messageexchange- the exchangecause- the caused exception- Returns:
- an error message (without stacktrace from exception)
-