public class ExceptionTranslator extends Object implements org.apache.camel.Processor
IntegrationException
s are preferred to default error codes in exceptions.
But error codes defined via AsynchConstants.EXCEPTION_ERROR_CODE
are preferred to exceptions at all.
Example of the generated SOAP fault response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring xml:lang="en">E102: the validation error (PredicateValidationException: Validation failed for Predicate[header{header(chargingKey)} is not null]. Exchange[SpringWebserviceMessage[SaajSoapMessage {http://openhubframework.org/ws/SubscriberService-v1}getCounterDataRequest]] )</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Modifier and Type | Method and Description |
---|---|
static String |
composeErrorMessage(ErrorExtEnum error,
Exception ex)
Composes error message.
|
static ErrorExtEnum |
getError(Throwable ex)
Gets
ErrorExtEnum of specified exception. |
static ExceptionTranslator |
getInstance()
Gets instance of
ExceptionTranslator . |
void |
process(org.apache.camel.Exchange exchange) |
public static ExceptionTranslator getInstance()
ExceptionTranslator
.public void process(org.apache.camel.Exchange exchange) throws Exception
process
in interface org.apache.camel.Processor
Exception
public static String composeErrorMessage(ErrorExtEnum error, Exception ex)
error
- the error codeex
- the exceptionpublic static ErrorExtEnum getError(Throwable ex)
ErrorExtEnum
of specified exception.ex
- the exceptionCopyright © 2018 Pivotal Software, Inc.. All rights reserved.